Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

List expectations for same method alongside unexpected invocation error message #177

Open
floehopper opened this issue Jan 5, 2014 · 1 comment

Comments

@floehopper
Copy link
Member

See #167. The idea is to make it more obvious what's gone wrong. I'm thinking along the following lines:

foo = mock('foo')
foo.expects(:bar).with(1)
foo.expects(:bar).with(2)

foo.bar(2)
foo.bar(3)
unexpected invocation: #<Mock:foo>.bar(3)
- expectations for same method:
  - expected exactly once, not yet invoked: #<Mock:foo>.bar(1)
  - expected exactly once, invoked once: #<Mock:foo>.bar(2)
unsatisfied expectations:
- expected exactly once, not yet invoked: #<Mock:foo>.bar(1)
satisfied expectations:
- expected exactly once, invoked once: #<Mock:foo>.bar(2)
@floehopper
Copy link
Member Author

See also #632.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant