[Rspec-users] mock parameter problem
micah at 8thlight.com
Tue Oct 24 23:08:22 EDT 2006
Here's another one.
m = mock("blah")
Mock 'blah' expected 'foo' once, but received it 0 times
Twice now I've gotten this failure message and wasted time trying to
understand why the method foo() was not being called despite all
evidence suggesting that it was being called. The problem is that
rSpec is lying to me. foo() is being called. The parameter is not
what's expected, but foo() is being called.
I'm not sure how fancy you guys want to get with the failure
messages, but more information is needed. Maybe:
Mock 'blah' expected 'foo(1)' once, but received it 0 times
Mock 'blah' expected 'foo' once with 1, but received it 1 time with 2
or to avoid the problem printing unknown parameters
Mock 'blah' expected 'foo' with one parameter, but received it 1 time
with the wrong parameter
Perhaps existing mock frameworks already have elegant terminology
that could be referenced.
I'll submit an RFE as soon as I figure out how.
8th Light, Inc.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Rspec-users