Skip to content

Commit

Permalink
Cut 0.31.0
Browse files Browse the repository at this point in the history
  • Loading branch information
koic committed May 6, 2023
1 parent 038293d commit 3edfc4e
Show file tree
Hide file tree
Showing 7 changed files with 54 additions and 4 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

## master (unreleased)

## 0.31.0 (2023-05-06)

### New features

* [#236](/~https://github.com/rubocop/rubocop-minitest/issues/236): Add new `Minitest/ReturnInTestMethod` cop. ([@fatkodima][])
Expand Down
2 changes: 1 addition & 1 deletion config/default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ Minitest/ReturnInTestMethod:
Description: 'Enforces the use of `skip` instead of `return` in test methods.'
StyleGuide: 'https://minitest.rubystyle.guide/#skipping-runnable-methods'
Enabled: pending
VersionAdded: '<<next>>'
VersionAdded: '0.31'

Minitest/SkipEnsure:
Description: 'Checks that `ensure` call even if `skip`.'
Expand Down
2 changes: 1 addition & 1 deletion docs/antora.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ name: rubocop-minitest
title: RuboCop Minitest
# We always provide version without patch here (e.g. 1.1),
# as patch versions should not appear in the docs.
version: ~
version: '0.31'
nav:
- modules/ROOT/nav.adoc
1 change: 1 addition & 0 deletions docs/modules/ROOT/pages/cops.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ based on the https://minitest.rubystyle.guide/[Minitest Style Guide].
* xref:cops_minitest.adoc#minitestrefutepredicate[Minitest/RefutePredicate]
* xref:cops_minitest.adoc#minitestrefuterespondto[Minitest/RefuteRespondTo]
* xref:cops_minitest.adoc#minitestrefutesame[Minitest/RefuteSame]
* xref:cops_minitest.adoc#minitestreturnintestmethod[Minitest/ReturnInTestMethod]
* xref:cops_minitest.adoc#minitestskipensure[Minitest/SkipEnsure]
* xref:cops_minitest.adoc#minitestskipwithoutreason[Minitest/SkipWithoutReason]
* xref:cops_minitest.adoc#minitesttestfilename[Minitest/TestFileName]
Expand Down
38 changes: 37 additions & 1 deletion docs/modules/ROOT/pages/cops_minitest.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -1015,7 +1015,8 @@ assert_equal [1, 2], foo, 'message'
| -
|===

Checks if test cases contain too many assertion calls.
Checks if test cases contain too many assertion calls. If conditional code with assertions
is used, the branch with maximum assertions is counted.
The maximum allowed assertion calls is configurable.

=== Examples
Expand Down Expand Up @@ -1618,6 +1619,41 @@ refute_same(expected, actual)

* https://minitest.rubystyle.guide#refute-same

== Minitest/ReturnInTestMethod

|===
| Enabled by default | Safe | Supports autocorrection | Version Added | Version Changed

| Pending
| Yes
| Yes
| 0.31
| -
|===

Enforces the use of `skip` instead of `return` in test methods.

=== Examples

[source,ruby]
----
# bad
def test_something
return if condition?
assert_equal(42, something)
end
# good
def test_something
skip if condition?
assert_equal(42, something)
end
----

=== References

* https://minitest.rubystyle.guide/#skipping-runnable-methods

== Minitest/SkipEnsure

|===
Expand Down
2 changes: 1 addition & 1 deletion lib/rubocop/minitest/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module RuboCop
module Minitest
# This module holds the RuboCop Minitest version information.
module Version
STRING = '0.30.0'
STRING = '0.31.0'

def self.document_version
STRING.match('\d+\.\d+').to_s
Expand Down
11 changes: 11 additions & 0 deletions relnotes/v0.31.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
### New features

* [#236](/~https://github.com/rubocop/rubocop-minitest/issues/236): Add new `Minitest/ReturnInTestMethod` cop. ([@fatkodima][])

### Changes

* [#250](/~https://github.com/rubocop/rubocop-minitest/pull/250): **(Breaking)** Drop Ruby 2.6 support. ([@koic][])
* [#249](/~https://github.com/rubocop/rubocop-minitest/pull/249): Handle assertions in conditionals branches in `Minitest/MultipleAssertions` cop. ([@fatkodima][])

[@fatkodima]: /~https://github.com/fatkodima
[@koic]: /~https://github.com/koic

0 comments on commit 3edfc4e

Please sign in to comment.