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

Already on GitHub? Sign in to your account

Better error message for `should_not_receive`/`expect().not_to have_recieved` combined w/ `with` #253

Closed
myronmarston opened this Issue Mar 29, 2013 · 2 comments

Comments

Projects
None yet
2 participants
Owner

myronmarston commented Mar 29, 2013

  example do
    dbl = double
    dbl.should_not_receive(:foo).with(:bar)
    dbl.foo(:bar)
    dbl
  end
  1) RSpec::Mocks
     Failure/Error: dbl.foo(:bar)
       (Double).foo(:bar)
           expected: 0 times
           received: 1 time

Notice the failure message does not mention anything about the args (which is why it failed)

Likewise:

  example do
    dbl = double.as_null_object
    dbl.foo(:bar)
    expect(dbl).not_to have_received(:foo).with(:bar)
  end
  1) RSpec::Mocks
     Failure/Error: expect(dbl).not_to have_received(:foo).with(:bar)
       (Double).foo(:bar)
           expected: 0 times
           received: 1 time

We should improve the failure message here.

@samphippen samphippen was assigned Apr 9, 2013

Owner

samphippen commented Apr 9, 2013

I'll try and take care of this one today 😺

Owner

samphippen commented Apr 21, 2013

Closing this as #269 got merged.

@samphippen samphippen closed this Apr 21, 2013

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