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

Matcher descriptions not used for received in too-many-calls failure output #890

Closed
myronmarston opened this issue Feb 10, 2015 · 0 comments
Labels

Comments

@myronmarston
Copy link
Member

it 'does not use matcher descriptions in the `received:` description' do
  dbl = double
  expect(dbl).to receive(:foo).with(anything, hash_including(bar: anything))

  dbl.foo(1, bar: 2)
  dbl.foo(1, bar: 3)
end

Fails with:

     Failure/Error: expect(dbl).to receive(:foo).with(anything, hash_including(bar: anything))
       (Double).foo(anything, hash_including(:bar=>"anything"))
           expected: 1 time with arguments: (anything, hash_including(:bar=>"anything"))
           received: 2 times with arguments: (#<RSpec::Mocks::ArgumentMatchers::AnyArgMatcher:0x007faefc2fb7c0>, #<RSpec::Mocks::ArgumentMatchers::HashIncludingMatcher:0x007faefebf62d8 @expected={:bar=>#<RSpec::Mocks::ArgumentMatchers::AnyArgMatcher:0x007faefc2fb7c0>}>)

Notice the inspect output of the matchers is used for received but the description is properly used for expected. It should be used for both.

imtayadeway pushed a commit to imtayadeway/rspec-mocks that referenced this issue Feb 10, 2015
imtayadeway pushed a commit to imtayadeway/rspec-mocks that referenced this issue Feb 10, 2015
imtayadeway pushed a commit to imtayadeway/rspec-mocks that referenced this issue Feb 11, 2015
@JonRowe JonRowe closed this as completed Feb 12, 2015
imtayadeway pushed a commit to imtayadeway/rspec-mocks that referenced this issue Feb 17, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants