DEV: Fix an rspec warning (#17123)
``` WARNING: Using `expect { }.not_to raise_error(SpecificErrorClass)` risks false positives, since literally any other error would cause the expectation to pass, including those raised by Ruby (e.g. `NoMethodError`, `NameError` and `ArgumentError`), meaning the code you are intending to test may not even get reached. Instead consider using `expect { }.not_to raise_error` or `expect { }.to raise_error(DifferentSpecificErrorClass)`. This message can be suppressed by setting: `RSpec::Expectations.configuration.on_potential_false_positives = :nothing`. Called from /var/www/discourse/spec/lib/retrieve_title_spec.rb:155:in `block (3 levels) in <main>'. ```
This commit is contained in:
parent
79d3b25d97
commit
fddd6fd5e0
|
@ -152,7 +152,7 @@ describe RetrieveTitle do
|
|||
it "it ignores Net::ReadTimeout errors" do
|
||||
stub_request(:get, "https://example.com").to_raise(Net::ReadTimeout)
|
||||
|
||||
expect { RetrieveTitle.crawl("https://example.com") }.not_to raise_error(Net::ReadTimeout)
|
||||
expect { RetrieveTitle.crawl("https://example.com") }.not_to raise_error
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue