Skip to content

Commit

Permalink
fixup! Apply the message change similar to #1139
Browse files Browse the repository at this point in the history
  • Loading branch information
pirj committed Feb 7, 2021
1 parent 60caa23 commit db7c4e4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/rspec/expectations/expectation_target.rb
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,10 @@ def enforce_value_expectation(matcher)
raise ArgumentError,
"The implicit block expectation syntax is not supported, you should pass " \
"a block rather than an argument to `expect` to use the provided " \
"block expectation matcher (#{RSpec::Support::ObjectFormatter.format(matcher)}), " \
"or the matcher must implement `supports_value_expectations?`."
"block expectation matcher or the matcher must implement " \
"`supports_value_expectations?`. e.g `expect { value }.to " \
"#{RSpec::Support::ObjectFormatter.format(matcher)}` not " \
"`expect(value).to #{RSpec::Support::ObjectFormatter.format(matcher)}`"
end

def supports_value_expectations?(matcher)
Expand Down

0 comments on commit db7c4e4

Please sign in to comment.