rspec/rules/S5783/description.adoc

8 lines
443 B
Plaintext
Raw Normal View History

When verifying that code raises an exception, a good practice is to avoid having multiple method calls inside the tested code, to be explicit about what is exactly tested.
2021-02-02 15:02:10 +01:00
When two of the methods can raise the same *checked* exception, not respecting this good practice is a bug, since it is not possible to know what is really tested.
2021-02-02 15:02:10 +01:00
You should make sure that only one method can raise the expected checked exception in the tested code.