simplecov icon indicating copy to clipboard operation
simplecov copied to clipboard

Invoking Custom Adapter in .simplecov Dies in Cucumber

Open stevenhaddox opened this issue 14 years ago • 1 comments

I'm hoping this is just for my project, but thought I'd write down the steps to reproduce just in case. I created a custom adapter in lib/simplecov_appname_adapater.rb that simply did:

SimpleCov.adapters.define 'appname' do
  load_adapter 'rails'
  add_filter '.bundle'
end

Then in the .simplecov file I had:

require 'simplecov_appname_adapter'
SimpleCov.start 'appname'

This seems to work fine in RSpec, but in Cucumber it states that simplecov__adapter could not be found. Any idea why Cucumber wouldn't be picking up a file from lib when RSpec is? I'm wondering if I just had a configuration issue or if this is possibly SimpleCov specific.

For now I'm just nuked the custom adapter and simply moved my filters into .simplecov such that it looks like:

SimpleCov.start 'rails' do
  add_filter '.bundle'
end

Thanks for such an awesome gem!

stevenhaddox avatar Mar 26 '12 08:03 stevenhaddox

I strongly suspect the $LOAD_PATH is set up differently in Cucumber, e.g. it appears the rails lib dir is not present in cucumber.

If you only use the adapter in this application, I totally recommend your current solution of just defining things in .simplecov. Adapters are both for supplying reusable parts from the simplecov gem (or other gems) and also were useful before the central .simplecov file was available. Right now, for single project config and multiple test suites, .simplecov is the way to go.

Glad you like the gem :)

colszowka avatar May 10 '12 14:05 colszowka