docs/modules/ROOT/pages/cops_minitest.adoc in rubocop-minitest-0.20.1 vs docs/modules/ROOT/pages/cops_minitest.adoc in rubocop-minitest-0.21.0
- old
+ new
@@ -377,9 +377,47 @@
=== References
* https://minitest.rubystyle.guide/#assert-predicate
+== Minitest/AssertRaisesCompoundBody
+
+|===
+| Enabled by default | Safe | Supports autocorrection | Version Added | Version Changed
+
+| Pending
+| Yes
+| No
+| 0.21
+| -
+|===
+
+Enforces the block body of `assert_raises { ... }` to be reduced to only the raising code.
+
+=== Examples
+
+[source,ruby]
+----
+# bad
+assert_raises(MyError) do
+ foo
+ bar
+end
+
+# good
+assert_raises(MyError) do
+ foo
+end
+
+# good
+assert_raises(MyError) do
+ foo do
+ bar
+ baz
+ end
+end
+----
+
== Minitest/AssertRespondTo
|===
| Enabled by default | Safe | Supports autocorrection | Version Added | Version Changed