Open pirj opened 5 years ago
Taken from Effective Testing with RSpec book. There's a matching RSpec/UnspecifiedException cop in RuboCop-RSpec.
RSpec/UnspecifiedException
Example problem with it.
The negated form has the opposite problem, and the exception should not be specified, as another exception may appear instead, the example will pass, and the code that is raising the exception in question won't even be run.
Worth mentioning the on_potential_false_positives config option?
on_potential_false_positives
https://www.andywaite.com/2018/07/15/prevent-false-positives-rspec-error.html
on_potential_false_positives with :raise is awesome 👍
:raise
Taken from Effective Testing with RSpec book. There's a matching
RSpec/UnspecifiedException
cop in RuboCop-RSpec.Example problem with it.
The negated form has the opposite problem, and the exception should not be specified, as another exception may appear instead, the example will pass, and the code that is raising the exception in question won't even be run.