[mocha-developer] mock framework ethics question
jamesmead44 at gmail.com
Fri Sep 21 12:20:19 EDT 2007
This is probably too late for you, but I'm inclined towards the third
"neither" option. This is because I prefer to stub the association method
itself which means I can use a standard mock for the model rather than an
rspec mock_model or whatever you call it.
On 22/08/2007, David Chelimsky <dchelimsky at gmail.com> wrote:
> Hi James, Jim, and everyone else who's listening.
> I've been investigating an interesting bug related to mocks and rails
> AssociationProxies. See
> for details.
> The crux is that if you do this (rspec mock syntax):
> and the implementation does this:
> 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 the three frameworks.
> So here's the mock-ethics question of the week:
> Should the comparison be changed to:
> actual == expected
> actual == expected || expected == actual
> or ... neither?
> I have arguments for all three - I'd like to hear your thoughts.
> mocha-developer mailing list
> mocha-developer at rubyforge.org
More information about the mocha-developer