Better error message for `should_not_receive`/`expect().not_to have_recieved` combined w/ `with`
Created by: myronmarston
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.