[rspec-users] engines causing problems with mocks

David Smalley david.smalley.lists at googlemail.com
Wed May 9 12:40:04 EDT 2007

As I delve further into using engines and rspec together I am  
noticing more strange issues.

describe "Requesting /admin/collections using get" do
   controller_name :admin_collections

   before(:each) do

   it "should return a collection of collection objects" do
     get 'index'
     response.should be_success

Gives me this error

undefined method `callback_events' for  
plugins/engines/lib/engines/rails_extensions/dependencies.rb:139 :in  
137    # if we managed to load a file, return true. If not, default  
to the original method.
138    # Note that this relies on the RHS of a boolean || not to be  
evaluated if the LHS is true.
139    file_loaded || require_or_load_without_engine_additions 
(file_name, const_path)
140  end
141  end

This looks like its coming from engines - but it could just be that  
engines has assumed responsibility for loading dependencies and that  
the error is really from rspec.

Any ideas?

I'm very keen to work on a project to create some rspec tasks that  
cater for people wanting to use it in conjunction with engines if  
anyone else has a similar problem.

Something along the lines of being able to say:

rake spec:engines:an_engine
rake spec:engines:an_engine:controllers
rake spec:engines:an_engine:models



More information about the rspec-users mailing list