rspec/rules/S3477/rule.adoc
Fred Tingaud d3cfe19d7e
Fix broken or dangerous backquotes
Co-authored-by: Marco Borgeaud <89914223+marco-antognini-sonarsource@users.noreply.github.com>
2023-10-30 10:33:56 +01:00

20 lines
445 B
Plaintext

== Why is this an issue?
If a ``++RuntimeException++`` is thrown while code is unit tested, it's likely to be thrown again in production. Therefore, test methods should be allowed to ``++throw RuntimeException++``s so you're alerted early to problems in the code.
=== Noncompliant code example
[source,text]
----
@Test
public void testTheThing() {
try {
// ...
} catch (RuntimeException e) { // Noncompliant
// ...
}
}
----