Skip to content

Add missing error types to raise_error matcher#1421

Merged
orta merged 2 commits into
danger:masterfrom
manicmaniac:specify-error-type
Jan 29, 2023
Merged

Add missing error types to raise_error matcher#1421
orta merged 2 commits into
danger:masterfrom
manicmaniac:specify-error-type

Conversation

@manicmaniac

Copy link
Copy Markdown
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

orta commented Jan 29, 2023

Copy link
Copy Markdown
Member

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.

2 participants