Skip to content

Commit

Permalink
Cut 0.30.0
Browse files Browse the repository at this point in the history
  • Loading branch information
koic committed Apr 6, 2023
1 parent b9278a9 commit 30a7d4e
Show file tree
Hide file tree
Showing 7 changed files with 58 additions and 3 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.30.0 (2023-04-06)

### New features

* [#248](https://github.com/rubocop/rubocop-minitest/pull/248): Make `Minitest/AssertInstanceOf` and `Minitest/RefuteInstanceOf` aware of `assert_equal(Class, object.class)` and `refute_equal(Class, object.class)`. ([@koic][])
Expand Down
2 changes: 1 addition & 1 deletion config/default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ Minitest/NoAssertions:
Minitest/NoTestCases:
Description: 'Checks if test class contains any test cases.'
Enabled: false
VersionAdded: '<<next>>'
VersionAdded: '0.30'

Minitest/NonPublicTestMethod:
Description: 'Detects non `public` (marked as `private` or `protected`) test methods.'
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.30'
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 @@ -40,6 +40,7 @@ based on the https://minitest.rubystyle.guide/[Minitest Style Guide].
* xref:cops_minitest.adoc#minitestliteralasactualargument[Minitest/LiteralAsActualArgument]
* xref:cops_minitest.adoc#minitestmultipleassertions[Minitest/MultipleAssertions]
* xref:cops_minitest.adoc#minitestnoassertions[Minitest/NoAssertions]
* xref:cops_minitest.adoc#minitestnotestcases[Minitest/NoTestCases]
* xref:cops_minitest.adoc#minitestnonpublictestmethod[Minitest/NonPublicTestMethod]
* xref:cops_minitest.adoc#minitestrefuteempty[Minitest/RefuteEmpty]
* xref:cops_minitest.adoc#minitestrefuteequal[Minitest/RefuteEqual]
Expand Down
40 changes: 40 additions & 0 deletions docs/modules/ROOT/pages/cops_minitest.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,10 @@ over `assert(object.instance_of?(Class))`.
assert(object.instance_of?(Class))
assert(object.instance_of?(Class), 'message')
# bad
assert_equal(Class, object.class)
assert_equal(Class, object.class, 'message')
# good
assert_instance_of(Class, object)
assert_instance_of(Class, object, 'message')
Expand Down Expand Up @@ -1082,6 +1086,38 @@ class FooTest < Minitest::Test
end
----

== Minitest/NoTestCases

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

| Disabled
| Yes
| No
| 0.30
| -
|===

Checks if test class contains any test cases.

=== Examples

[source,ruby]
----
# bad
class FooTest < Minitest::Test
def do_something
end
end
# good
class FooTest < Minitest::Test
def test_something
assert true
end
end
----

== Minitest/NonPublicTestMethod

|===
Expand Down Expand Up @@ -1337,6 +1373,10 @@ over `refute(object.instance_of?(Class))`.
refute(object.instance_of?(Class))
refute(object.instance_of?(Class), 'message')
# bad
refute_equal(Class, object.class)
refute_equal(Class, object.class, 'message')
# good
refute_instance_of(Class, object)
refute_instance_of(Class, object, 'message')
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.29.0'
STRING = '0.30.0'

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

* [#248](https://github.com/rubocop/rubocop-minitest/pull/248): Make `Minitest/AssertInstanceOf` and `Minitest/RefuteInstanceOf` aware of `assert_equal(Class, object.class)` and `refute_equal(Class, object.class)`. ([@koic][])
* [#244](https://github.com/rubocop/rubocop-minitest/pull/244): Make `Minitest/GlobalExpectations` aware of `must_pattern_match` and `wont_pattern_match` matchers. ([@koic][])
* [#216](https://github.com/rubocop/rubocop-minitest/issues/216): Add new `Minitest/NoTestCases` cop. ([@tejasbubane][])

### Bug fixes

* [#247](https://github.com/rubocop/rubocop-minitest/pull/247): Prevent breaking change for assertion message in test. ([@koic][])

[@koic]: https://github.com/koic
[@tejasbubane]: https://github.com/tejasbubane

0 comments on commit 30a7d4e

Please sign in to comment.