Skip to content

Bypass RSpec::Mocks::Syntax when mass-assigning stubs via double().

gitlab-qa-bot requested to merge github/fork/pda/expect_syntax_assign_stubs into master

Created by: pda

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.


Note: I believe this bulid failed due to an unrelated transient error.

Merge request reports