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

Add missing error types to raise_error matcher #1421

Merged
merged 2 commits into from Jan 29, 2023

Conversation

manicmaniac
Copy link
Member

Resolve the following warning on bundle exec rspec spec/lib/danger/request_sources/bitbucket_cloud_api_spec.rb.

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 #<WebMock::NetConnectNotAllowedError: Real HTTP
connections are disabled. Unregistered request: GET h... => 200, :body => "",
:headers => {})

============================================================>. 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/rito/Projects/danger/danger/spec/lib/danger/request_sources/bitbucket_cloud_api_spec.rb:104:in
`block (3 levels) in <top (required)>'.

@orta
Copy link
Member

orta commented Jan 29, 2023

Thanks!

@orta orta closed this Jan 29, 2023
@orta orta reopened this Jan 29, 2023
@orta orta merged commit 16ba1f5 into danger:master Jan 29, 2023
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.

None yet

2 participants