rspec/rspec-mocks — pull request #306 by pda (2013-06-12 11:33:29+00:00)
Title: Bypass RSpec::Mocks::Syntax when mass-assigning stubs via double().

When mock_with's `config.syntax = [:expect]`, the `#stub` method is not
available on the TestDouble. This results in test errors.

This change bypasses the pluggable syntax layer, directly setting up allowance
for a Matcher::Receive instance.

Another option would be to use AcceptanceTarget.new(self).to(matcher) however
the `#to` DSL-like method feels out of place when not used with the
`allow(target)` receiver syntax, and also the AcceptanceTarget delegation
implementation complexity is not required for internals like this.