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

Update RSpec raise_error to be more specific #24

Merged
merged 1 commit into from
Jul 27, 2016
Merged

Conversation

shortdudey123
Copy link
Owner

Fixes the 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 #<YamlLint::FileNotFoundError: /does/not/exist: no such file>. 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 /Users/username/github/yamllint/spec/linter_spec.rb:12:in `block (2 levels) in <top (required)>'.

Fixes the 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 #<YamlLint::FileNotFoundError: /does/not/exist: no such file>. 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 /Users/username/github/yamllint/spec/linter_spec.rb:12:in `block (2 levels) in <top (required)>'.
```
@shortdudey123 shortdudey123 merged commit b562cd1 into master Jul 27, 2016
@shortdudey123 shortdudey123 deleted the update_rspec branch July 27, 2016 04:39
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