-
-
Notifications
You must be signed in to change notification settings - Fork 102
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
Internal affairs: expect_warn_deprecation
matches any message when there's fail
in the example
#451
Comments
The use of non-nested expectation resolves the issue: expect(RSpec.configuration.reporter).to
receive(:deprecation).with(include(message: match(/Tahe/))) just for the reference, original implementation: def expect_warn_deprecation(snippet=//)
expect(RSpec.configuration.reporter).to receive(:deprecation) do |options|
message = options[:message]
expect(message).to match(snippet)
end
end |
That approach looks reasonable, is there a PR? |
There are no tests for the whole file, it's tricky to write, takes me a while. |
I fail to write a test that would fail for the current implementation 😬 Along the way I discovered that around { |example| in_sub_process { example.run } } doesn't work, marks all examples as pending. |
Subject of the issue
expect_warn_deprecation
matches any message when there'sraise_error(RSpec::Expectations::ExpectationNotMetError)
in the example.Might affect other rspec-support deprecation matcher helpers.
Your environment
Steps to reproduce
Original code:
Simplification:
Expected behavior
or
Actual behavior
:aggregate_failures
fixes the issue with the first expectation, it is now printed, but now the inner failure is propagated.The text was updated successfully, but these errors were encountered: