Skip to content

Commit

Permalink
Cut 0.19.0
Browse files Browse the repository at this point in the history
  • Loading branch information
koic committed Apr 5, 2022
1 parent 3a05f46 commit 398f654
Show file tree
Hide file tree
Showing 7 changed files with 68 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## master (unreleased)

## 0.19.0 (2022-04-05)

### New features

* [#164](https://github.com/rubocop/rubocop-minitest/pull/164): Add new `Minitest/DuplicateTestRun cop. ([@ignacio-chiazzo][])
Expand Down
2 changes: 1 addition & 1 deletion config/default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ Minitest/AssertionInLifecycleHook:
Minitest/DuplicateTestRun:
Description: 'This cop detects duplicate test runs caused by one test class inheriting from another.'
Enabled: pending
VersionAdded: '<<next>>'
VersionAdded: '0.19'

Minitest/GlobalExpectations:
Description: 'This cop checks for deprecated global expectations.'
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: 'master'
version: '0.19'
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 @@ -30,6 +30,7 @@ based on the https://minitest.rubystyle.guide/[Minitest Style Guide].
* xref:cops_minitest.adoc#minitestasserttruthy[Minitest/AssertTruthy]
* xref:cops_minitest.adoc#minitestassertwithexpectedargument[Minitest/AssertWithExpectedArgument]
* xref:cops_minitest.adoc#minitestassertioninlifecyclehook[Minitest/AssertionInLifecycleHook]
* xref:cops_minitest.adoc#minitestduplicatetestrun[Minitest/DuplicateTestRun]
* xref:cops_minitest.adoc#minitestglobalexpectations[Minitest/GlobalExpectations]
* xref:cops_minitest.adoc#minitestliteralasactualargument[Minitest/LiteralAsActualArgument]
* xref:cops_minitest.adoc#minitestmultipleassertions[Minitest/MultipleAssertions]
Expand Down
57 changes: 57 additions & 0 deletions docs/modules/ROOT/pages/cops_minitest.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -544,6 +544,63 @@ class FooTest < Minitest::Test
end
----

== Minitest/DuplicateTestRun

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

| Pending
| Yes
| No
| 0.19
| -
|===

If a Minitest class inherits from another class,
it will also inherit its methods causing Minitest to run the parent's tests methods twice.

This cop detects when there are two tests classes, one inherits from the other, and both have tests methods.
This cop will add an offence to the Child class in such a case.

=== Examples

[source,ruby]
----
# bad
class ParentTest < Minitest::Test
def test_parent # it will run this test twice.
end
end
class ChildTest < ParentTest
def test_child
end
end
# good
class ParentTest < Minitest::Test
def test_parent
end
end
class ChildTest < Minitest::Test
def test_child
end
end
# good
class ParentTest < Minitest::Test
end
class ChildTest
def test_child
end
def test_parent
end
end
----

== Minitest/GlobalExpectations

|===
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.18.0'
STRING = '0.19.0'

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

* [#164](https://github.com/rubocop/rubocop-minitest/pull/164): Add new `Minitest/DuplicateTestRun cop. ([@ignacio-chiazzo][])

[@ignacio-chiazzo]: https://github.com/ignacio-chiazzo

0 comments on commit 398f654

Please sign in to comment.