Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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 join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant