rspec / rspec-support

Common code needed by the other RSpec gems. Not intended for direct use.
https://rspec.info
MIT License
98 stars 103 forks source link

Fix expect_warn_deprecation matching any message #452

Closed pirj closed 3 years ago

pirj commented 3 years ago

expect_warn_deprecation matches any message when there's raise_error(RSpec::Expectations::ExpectationNotMetError) in the example, e.g.:

it 'prints a deprecation warning when given a value and negated' do
  expect_warn_deprecation(/complete nonsense/)
  expect { expect(3).not_to matcher }.to fail
end

fixes: #451

I'm sending against main, but it needs to be merged to 4-0-dev as well.

pirj commented 3 years ago
       -["include {:message => (match /The #<Class:0x00005577a8117798> formatter uses the deprecated formatter interface/), :call_site => (include \"/home/runner/work/rspec-support/rspec-core/spec/rspec/core/formatters_spec.rb:88\")}"]
       +[{:message=>
       +   " The #<Class:0x00005577a8117798> formatter uses the deprecated formatter interface not supported directly by RSpec 3.  To continue to use this formatter you must install the `rspec-legacy_formatters` gem, which provides support for legacy formatters or upgrade the formatter to a compatible version.  Formatter added at: /home/runner/work/rspec-support/rspec-core/spec/rspec/core/formatters_spec.rb:88:in `block (4 levels) in <module:Formatters>'\n"}]

Seems like one legitimate failure has been found.

JonRowe commented 3 years ago

I kicked the build over but its still failing, so it looks like it wasn't enough?

pirj commented 3 years ago

Yep, ~rspec-mocks~ rspec-expectations this time. Will send out a fix.

JonRowe commented 3 years ago

Build kicked over again

pirj commented 3 years ago

Green.

pirj commented 3 years ago

Not so sure about 1.8.7 and co though.

JonRowe commented 3 years ago

The travis builds have gotten even more broken 😂 I'm going to have to look at that this weekend