Displaying 1 result from an estimated 1 matches for "containing_model".
2007 Aug 22
1
mock framework ethics question
...elated to mocks and rails
AssociationProxies. See
http://rubyforge.org/tracker/?func=detail&atid=3149&aid=12547&group_id=797
for details.
The crux is that if you do this (rspec mock syntax):
obj.should_receive(:msg).with(mock_of_a_model)
and the implementation does this:
obj.msg(containing_model.association_proxy)
the expectation fails. This is because the comparison that rspec mocks make is:
expected == actual
which, in this case ends up being:
mock_of_a_model == association_proxy
As it turns out, mocha and flexmock do this the same way, which means
that this will fail in any of...