Hi,
I''m getting the following error when running spec on my controller:
#<Mock:core>.core_file=(#<Mock:core_file>) - expected calls: 0,
actual
calls: 1
This is my mocha rspec setup:
@core = mock(''core'')
core_file = mock(''core_file'')
Core.stubs(:new).returns(@core)
And this is the line in my controller on which it fails:
@core.core_file = @core_file
I tried stubbing core_file of @core, but that didn''t do anything (e.g.
@core.stubs(''core_file'').returns(core_file)). And it makes
sense,
because in the controller, I assign core_file - I don''t access
core_file.
So, the question comes down to: how do I stub instance variable
assignment?
Thanks,
Tiberiu
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---