Skip to content
This repository was archived by the owner on Nov 30, 2024. It is now read-only.

Fix expect_warn_deprecation matching any message #453

Merged
merged 1 commit into from
Dec 18, 2020

Conversation

pirj
Copy link
Member

@pirj pirj commented Dec 18, 2020

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 # where `fail` is a matcher, not Ruby's method
end

See #451

This depends on rspec/rspec-expectations#1244 and rspec/rspec-core#2802

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
@pirj pirj self-assigned this Dec 18, 2020
@pirj pirj requested a review from JonRowe December 18, 2020 12:44
@pirj pirj merged commit 12a2a50 into 4-0-dev Dec 18, 2020
@pirj pirj deleted the fix-deprecation-expectation branch December 18, 2020 15:37
yujinakayama pushed a commit to yujinakayama/rspec-monorepo that referenced this pull request Oct 19, 2021
…eprecation-expectation

Fix expect_warn_deprecation matching any message

---
This commit was imported from rspec/rspec-support@12a2a50.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant