Resolve warning about test using not_to raise_error

Resolves:

> 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 commit is contained in:
Andrew Kvalheim 2021-06-18 11:32:10 -07:00 committed by Henne Vogelsang
parent 23ee15f10d
commit e449d78e23
No known key found for this signature in database
GPG key ID: 97DDB66BDAF8D4D6

View file

@ -50,6 +50,6 @@ describe TicketPdf do
.to_return(status: 404, body: '', headers: {})
pdf = described_class.new(conference, participant, physical_ticket, layout, file_name)
expect{ PDF::Inspector::Page.analyze(pdf.render) }.to_not raise_error(OpenURI::HTTPError)
expect{ PDF::Inspector::Page.analyze(pdf.render) }.to_not raise_error
end
end