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

Specify exception class to raise_error matcher warning #537

Merged
merged 1 commit into from
Nov 26, 2018

Conversation

yujideveloper
Copy link
Contributor

Fixed a following warning:

WARNING: Using the `raise_error` matcher without providing a specific error or message risks false positives, since `raise_error` will match when Ruby raises a `NoMethodError`, `NameError` or `ArgumentError`, potentially allowing the expectation to pass without even executing the method you are intending to call. Actual error raised was RuntimeError.  Instead consider providing a specific error class or message. This message can be suppressed by setting: `RSpec::Expectations.configuration.on_potential_false_positives = :nothing`. Called from /home/travis/build/phstc/shoryuken/spec/shoryuken/middleware/server/auto_extend_visibility_spec.rb:56:in `block (2 levels) in <top (required)>'.

https://travis-ci.org/phstc/shoryuken/jobs/458056177#L588

Fixed a following warning:
```
WARNING: Using the `raise_error` matcher without providing a specific error or message risks false positives, since `raise_error` will match when Ruby raises a `NoMethodError`, `NameError` or `ArgumentError`, potentially allowing the expectation to pass without even executing the method you are intending to call. Actual error raised was RuntimeError.  Instead consider providing a specific error class or message. This message can be suppressed by setting: `RSpec::Expectations.configuration.on_potential_false_positives = :nothing`. Called from /home/travis/build/phstc/shoryuken/spec/shoryuken/middleware/server/auto_extend_visibility_spec.rb:56:in `block (2 levels) in <top (required)>'.
```
@phstc phstc merged commit f01c31d into ruby-shoryuken:master Nov 26, 2018
@phstc
Copy link
Collaborator

phstc commented Nov 26, 2018

Thanks @yujideveloper. Added to master 🍻 ❤️

@yujideveloper yujideveloper deleted the fix/spec-warning branch November 26, 2018 13:17
@phstc phstc changed the title Specify exception class to raise_error matcher Specify exception class to raise_error matcher warning Nov 26, 2018
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.

2 participants