From 216db5374e0186b57b1f32bc1a19ac4527a27a91 Mon Sep 17 00:00:00 2001 From: Phil Pirozhkov Date: Thu, 17 Dec 2020 22:55:43 +0300 Subject: [PATCH] Fix ill-defined warn expectation -["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=> + "#<#: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 ')\n", + :type=>"legacy_matcher"}] See https://github.com/rspec/rspec-support/pull/452 --- spec/rspec/matchers/legacy_spec.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/rspec/matchers/legacy_spec.rb b/spec/rspec/matchers/legacy_spec.rb index 8a7df1705..6ff371c5c 100644 --- a/spec/rspec/matchers/legacy_spec.rb +++ b/spec/rspec/matchers/legacy_spec.rb @@ -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 @@ -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