rspec/rspec-mocks — pull request #269 by samphippen (2013-04-09 17:01:45+00:00)
Title: Give a better error message on received expectations with args

Related #253

So I've built something that seems a bit alright. I'm not sure this totally makes sense on things like, I'd love some feedback on that.
```
expected: 0 times with any arguments
received: 1 time
```

An example spec:

```ruby
describe "bees" do
it "should things" do
dbl = double
dbl.should_not_receive(:foo).with(:bar)
dbl.foo(:bar)
dbl
end

it "should also things" do
dbl = double.as_null_object
dbl.foo(:bar)
expect(dbl).not_to have_received(:foo).with(:bar)
end
end

```
and execution result:

```
FF

Failures:

1) bees should things
Failure/Error: dbl.foo(:bar)
(Double).foo(:bar)
expected: 0 times with arguments: (:bar)
received: 1 time with arguments: (:bar)
# ./253_spec.rb:5:in `block (2 levels) in '

2) bees should also things
Failure/Error: expect(dbl).not_to have_received(:foo).with(:bar)
(Double).foo(:bar)
expected: 0 times with arguments: (:bar)
received: 1 time with arguments: (:bar)
# ./253_spec.rb:12:in `block (2 levels) in '

Finished in 0.00085 seconds
2 examples, 2 failures

Failed examples:

rspec ./253_spec.rb:2 # bees should things
rspec ./253_spec.rb:9 # bees should also things
```