Skip to content

Commit

Permalink
[expectations] Fix ill-defined warn expectation
Browse files Browse the repository at this point in the history
        -["include {:message => (match /legacy\\s+RSpec\\s+matcher/), :call_site => (include \"/home/runner/work/rspec-support/rspec-expectations/spec/rspec/matchers/legacy_spec.rb:31\")}"]
       +[{:message=>
       +   "#<#<Class:0x000055fcd6e44840>:0x000055fcd6e52bc0> implements a legacy RSpec matcher\nprotocol. For the current protocol you should expose the failure messages\nvia the `failure_message` and `failure_message_when_negated` methods.\n(Used from /home/runner/work/rspec-support/rspec-expectations/spec/rspec/matchers/legacy_spec.rb:31:in `block (4 levels) in <module:Matchers>')\n",
       +  :type=>"legacy_matcher"}]

See rspec/rspec-support#452

---
This commit was imported from rspec/rspec-expectations@216db53.
  • Loading branch information
pirj committed Dec 18, 2020
1 parent 92a4be4 commit 17da193
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions rspec-expectations/spec/rspec/matchers/legacy_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def failure_message_when_negated; "failure when negative"; end
end

it 'warns about the deprecated protocol' do
expect_warn_deprecation_with_call_site(__FILE__, __LINE__ + 1, /legacy\s+RSpec\s+matcher/)
expect_warn_deprecation(/legacy\s+RSpec\s+matcher.+#{__FILE__}:#{__LINE__ + 1}/m)
expect(true).to matcher
end

Expand All @@ -48,7 +48,7 @@ def failure_message_when_negated; "failure when negative"; end
end

it 'warns about the deprecated protocol' do
expect_warn_deprecation_with_call_site(__FILE__, __LINE__ + 1, /legacy\s+RSpec\s+matcher/)
expect_warn_deprecation(/legacy\s+RSpec\s+matcher.+#{__FILE__}:#{__LINE__ + 1}/m)
expect(false).not_to matcher
end

Expand Down

0 comments on commit 17da193

Please sign in to comment.