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:
Jarek Radosz 2022-06-17 13:45:16 +02:00 committed by GitHub
parent 79d3b25d97
commit fddd6fd5e0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -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