rspec/rspec-mocks — pull request #523 by jdelStrother (2014-01-09 11:35:41+00:00)
Title: Verify the last argument is called in receive_message_chain

Prior to this, something like -
```ruby
expect(object).to receive_message_chain(:foo, :bar => 1)
object.foo
```
would pass, despite 'bar' not being called.

===

After applying these changes to message_chain.rb, the existing spec ["raises when expect is used and the entire chain isn't called"](https://github.com/jdelStrother/rspec-mocks/blob/3656675e2313ba8b519a23704a2944a9fc74bbb5/spec/rspec/mocks/matchers/receive_message_chain_spec.rb#L117) started failing - it expects a single MockExpectationError to be raised, whereas you actually get one raised from the explicit call to `verify_all` (that `farce` wasn't called), then the implicit `verify_all` kicks in at the end of the spec and finds that `length` wasn't called either (which causes the spec to fail).

`reset()` seems to commonly be used to fix these sort problems in rspec's specs, but I couldn't figure out how to reset the right double with a message chain. Here, I work around it with `begin; verify_all; rescue RSpec::Mocks::MockExpectationError; end`. Any better suggestions?