rubocop-minitest 0.10.2 → 0.12.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.circleci/config.yml +3 -3
- data/.github/ISSUE_TEMPLATE/bug_report.md +5 -1
- data/.rubocop.yml +4 -1
- data/CHANGELOG.md +96 -51
- data/CONTRIBUTING.md +3 -3
- data/Gemfile +2 -2
- data/LICENSE.txt +1 -1
- data/README.md +4 -4
- data/Rakefile +1 -1
- data/bin/console +2 -0
- data/config/default.yml +15 -4
- data/docs/antora.yml +1 -1
- data/docs/modules/ROOT/pages/cops.adoc +2 -0
- data/docs/modules/ROOT/pages/cops_minitest.adoc +78 -7
- data/docs/modules/ROOT/pages/index.adoc +1 -1
- data/legacy-docs/cops_minitest.md +16 -16
- data/legacy-docs/index.md +1 -1
- data/lib/rubocop/cop/minitest/assert_empty.rb +1 -1
- data/lib/rubocop/cop/minitest/assert_empty_literal.rb +12 -16
- data/lib/rubocop/cop/minitest/assert_equal.rb +1 -1
- data/lib/rubocop/cop/minitest/assert_in_delta.rb +4 -1
- data/lib/rubocop/cop/minitest/assert_includes.rb +1 -1
- data/lib/rubocop/cop/minitest/assert_instance_of.rb +1 -1
- data/lib/rubocop/cop/minitest/assert_kind_of.rb +1 -1
- data/lib/rubocop/cop/minitest/assert_match.rb +1 -1
- data/lib/rubocop/cop/minitest/assert_nil.rb +5 -11
- data/lib/rubocop/cop/minitest/assert_output.rb +1 -1
- data/lib/rubocop/cop/minitest/assert_path_exists.rb +6 -12
- data/lib/rubocop/cop/minitest/assert_respond_to.rb +1 -1
- data/lib/rubocop/cop/minitest/assert_silent.rb +8 -6
- data/lib/rubocop/cop/minitest/assert_truthy.rb +5 -11
- data/lib/rubocop/cop/minitest/assert_with_expected_argument.rb +41 -0
- data/lib/rubocop/cop/minitest/assertion_in_lifecycle_hook.rb +1 -1
- data/lib/rubocop/cop/minitest/global_expectations.rb +6 -7
- data/lib/rubocop/cop/minitest/literal_as_actual_argument.rb +15 -14
- data/lib/rubocop/cop/minitest/multiple_assertions.rb +2 -2
- data/lib/rubocop/cop/minitest/no_assertions.rb +48 -0
- data/lib/rubocop/cop/minitest/refute_empty.rb +1 -1
- data/lib/rubocop/cop/minitest/refute_equal.rb +6 -7
- data/lib/rubocop/cop/minitest/refute_false.rb +15 -22
- data/lib/rubocop/cop/minitest/refute_in_delta.rb +4 -1
- data/lib/rubocop/cop/minitest/refute_includes.rb +1 -1
- data/lib/rubocop/cop/minitest/refute_instance_of.rb +1 -1
- data/lib/rubocop/cop/minitest/refute_kind_of.rb +1 -1
- data/lib/rubocop/cop/minitest/refute_match.rb +1 -1
- data/lib/rubocop/cop/minitest/refute_nil.rb +4 -8
- data/lib/rubocop/cop/minitest/refute_path_exists.rb +6 -12
- data/lib/rubocop/cop/minitest/refute_respond_to.rb +1 -1
- data/lib/rubocop/cop/minitest/test_method_name.rb +18 -8
- data/lib/rubocop/cop/minitest/unspecified_exception.rb +1 -1
- data/lib/rubocop/cop/minitest_cops.rb +2 -0
- data/lib/rubocop/cop/mixin/in_delta_mixin.rb +5 -15
- data/lib/rubocop/cop/mixin/minitest_cop_rule.rb +12 -12
- data/lib/rubocop/cop/mixin/minitest_exploration_helpers.rb +20 -3
- data/lib/rubocop/minitest/version.rb +1 -1
- data/mkdocs.yml +2 -2
- data/relnotes/v0.1.0.md +1 -1
- data/relnotes/v0.10.0.md +12 -12
- data/relnotes/v0.10.1.md +1 -1
- data/relnotes/v0.10.2.md +1 -1
- data/relnotes/v0.10.3.md +5 -0
- data/relnotes/v0.11.0.md +16 -0
- data/relnotes/v0.11.1.md +5 -0
- data/relnotes/v0.12.0.md +10 -0
- data/relnotes/v0.12.1.md +5 -0
- data/relnotes/v0.2.0.md +4 -4
- data/relnotes/v0.2.1.md +1 -1
- data/relnotes/v0.3.0.md +6 -6
- data/relnotes/v0.4.0.md +5 -5
- data/relnotes/v0.4.1.md +1 -1
- data/relnotes/v0.5.0.md +1 -1
- data/relnotes/v0.5.1.md +1 -1
- data/relnotes/v0.6.0.md +1 -1
- data/relnotes/v0.6.1.md +2 -2
- data/relnotes/v0.6.2.md +1 -1
- data/relnotes/v0.7.0.md +5 -5
- data/relnotes/v0.8.0.md +4 -4
- data/relnotes/v0.8.1.md +1 -1
- data/relnotes/v0.9.0.md +3 -3
- data/rubocop-minitest.gemspec +5 -5
- data/tasks/cops_documentation.rake +9 -11
- metadata +17 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3e7a3871e612b7ff9a9fd9c5c83bb092ea6097f6b4838246b45346dd4ccc0d4a
|
4
|
+
data.tar.gz: 1ba5c7ebe8764918e623fc45a5dc198700172ea5892db6744cbfd01eaf449023
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9ddaa753e8ed446249b730b252e6c7d5e7b2b8029e65c025cd5a7b451fd53f9b0205e8bded8e7aa3be8ec476322c600d04b7b88c300543d8266526ab92a491e0
|
7
|
+
data.tar.gz: 404825f75cd7d39bb6945dcda51f17c012529874feb662b4f4eeb821c63b4931f49ff64391b7deac1111361bd4fd4e458740f1e2c20047d8898d9ae3192c6341
|
data/.circleci/config.yml
CHANGED
@@ -38,9 +38,6 @@ workflows:
|
|
38
38
|
build:
|
39
39
|
jobs:
|
40
40
|
- documentation-checks
|
41
|
-
- rake_default:
|
42
|
-
name: Ruby 2.4
|
43
|
-
image: circleci/ruby:2.4
|
44
41
|
- rake_default:
|
45
42
|
name: Ruby 2.5
|
46
43
|
image: circleci/ruby:2.5
|
@@ -50,6 +47,9 @@ workflows:
|
|
50
47
|
- rake_default:
|
51
48
|
name: Ruby 2.7
|
52
49
|
image: circleci/ruby:2.7
|
50
|
+
- rake_default:
|
51
|
+
name: Ruby 3.0
|
52
|
+
image: circleci/ruby:3.0
|
53
53
|
- rake_default:
|
54
54
|
name: Ruby HEAD
|
55
55
|
image: rubocophq/circleci-ruby-snapshot:latest # Nightly snapshot build
|
@@ -32,8 +32,12 @@ a problem will expedite its solution.
|
|
32
32
|
## RuboCop version
|
33
33
|
|
34
34
|
Include the output of `rubocop -V` or `bundle exec rubocop -V` if using Bundler. Here's an example:
|
35
|
+
You see extension cop versions (e.g. rubocop-minitest, rubocop-performance, and others) output by rubocop -V,
|
36
|
+
include them as well. Here's an example:
|
35
37
|
|
36
38
|
```
|
37
39
|
$ [bundle exec] rubocop -V
|
38
|
-
|
40
|
+
1.10.0 (using Parser 3.0.0.0, rubocop-ast 1.4.1, running on ruby 3.0.0 x86_64-darwin19)
|
41
|
+
- rubocop-minitest 0.10.3
|
42
|
+
- rubocop-performance 1.9.2
|
39
43
|
```
|
data/.rubocop.yml
CHANGED
@@ -9,9 +9,12 @@ require:
|
|
9
9
|
|
10
10
|
AllCops:
|
11
11
|
NewCops: enable
|
12
|
-
TargetRubyVersion: 2.
|
12
|
+
TargetRubyVersion: 2.5
|
13
13
|
SuggestExtensions: false
|
14
14
|
|
15
|
+
InternalAffairs/NodeMatcherDirective:
|
16
|
+
Enabled: false
|
17
|
+
|
15
18
|
Naming/PredicateName:
|
16
19
|
# Method define macros for dynamically generated method.
|
17
20
|
MethodDefinitionMacros:
|
data/CHANGELOG.md
CHANGED
@@ -2,165 +2,208 @@
|
|
2
2
|
|
3
3
|
## master (unreleased)
|
4
4
|
|
5
|
+
## 0.12.1 (2021-04-25)
|
6
|
+
|
7
|
+
### Bug fixes
|
8
|
+
|
9
|
+
* [#131](https://github.com/rubocop/rubocop-minitest/issues/131): Fix an error for `Minitest/MultipleAssertions` and fixes a false positive for `test` block. ([@koic][])
|
10
|
+
|
11
|
+
## 0.12.0 (2021-04-23)
|
12
|
+
|
13
|
+
### New features
|
14
|
+
|
15
|
+
* [#124](https://github.com/rubocop/rubocop-minitest/pull/124): Add new `Minitest/NoAssertions` cop. ([@ghiculescu][])
|
16
|
+
|
17
|
+
### Changes
|
18
|
+
|
19
|
+
* [#129](https://github.com/rubocop/rubocop-minitest/pull/129): Drop Ruby 2.4 support. ([@koic][])
|
20
|
+
|
21
|
+
## 0.11.1 (2021-03-31)
|
22
|
+
|
23
|
+
### Changes
|
24
|
+
|
25
|
+
* [#126](https://github.com/rubocop/rubocop-minitest/issues/126): Mark `Minitest/AssertWithExpectedArgument` as unsafe. ([@koic][])
|
26
|
+
|
27
|
+
## 0.11.0 (2021-03-22)
|
28
|
+
|
29
|
+
### New features
|
30
|
+
|
31
|
+
* [#117](https://github.com/rubocop/rubocop-minitest/issues/117): Add new cop `Minitest/AssertWithExpectedArgument` to check for unintended usages of `assert` instead of `assert_equal`. ([@cstyles][])
|
32
|
+
|
33
|
+
### Bug fixes
|
34
|
+
|
35
|
+
* [#122](https://github.com/rubocop/rubocop-minitest/pull/122): Fix `Minitest/TestMethodName` for tests with multiple assertions. ([@ghiculescu][])
|
36
|
+
|
37
|
+
### Changes
|
38
|
+
|
39
|
+
* [#118](https://github.com/rubocop/rubocop-minitest/pull/118): **(BREAKING)** Fix `Minitest/AssertEmptyLiteral` by making it check for `assert_equal([], array)` instead of `assert([], array)`. ([@cstyles][])
|
40
|
+
* [#125](https://github.com/rubocop/rubocop-minitest/pull/125): Require RuboCop 0.90 or higher. ([@koic][])
|
41
|
+
|
42
|
+
## 0.10.3 (2021-01-12)
|
43
|
+
|
44
|
+
### Bug fixes
|
45
|
+
|
46
|
+
* [#115](https://github.com/rubocop/rubocop-minitest/issues/115): Fix a false positive for `Minitest/TestMethodName` for when defining test method has an argument, and test method without assertion methods. ([@koic][])
|
47
|
+
|
5
48
|
## 0.10.2 (2020-12-27)
|
6
49
|
|
7
50
|
### Bug fixes
|
8
51
|
|
9
|
-
* [#113](https://github.com/rubocop
|
52
|
+
* [#113](https://github.com/rubocop/rubocop-minitest/issues/113): Fix an error for `Minitest/AssertEqual` and some cops when using `assert` with block argument. ([@koic][])
|
10
53
|
|
11
54
|
## 0.10.1 (2020-07-25)
|
12
55
|
|
13
56
|
### Bug fixes
|
14
57
|
|
15
|
-
* [#106](https://github.com/rubocop
|
58
|
+
* [#106](https://github.com/rubocop/rubocop-minitest/issues/106): Fix an error for `Minitest/AssertOutput` when using gvar at top level. ([@koic][])
|
16
59
|
|
17
60
|
## 0.10.0 (2020-07-12)
|
18
61
|
|
19
62
|
### New features
|
20
63
|
|
21
|
-
* [#92](https://github.com/rubocop
|
22
|
-
* [#95](https://github.com/rubocop
|
23
|
-
* [#91](https://github.com/rubocop
|
24
|
-
* [#89](https://github.com/rubocop
|
25
|
-
* [#83](https://github.com/rubocop
|
26
|
-
* [#88](https://github.com/rubocop
|
27
|
-
* [#87](https://github.com/rubocop
|
28
|
-
* [#96](https://github.com/rubocop
|
29
|
-
* [#98](https://github.com/rubocop
|
30
|
-
* [#84](https://github.com/rubocop
|
31
|
-
* [#85](https://github.com/rubocop
|
64
|
+
* [#92](https://github.com/rubocop/rubocop-minitest/pull/92): Add new `Minitest/LiteralAsActualArgument` cop. ([@fatkodima][], [@tsmmark][])
|
65
|
+
* [#95](https://github.com/rubocop/rubocop-minitest/pull/95): Add new `Minitest/AssertionInLifecycleHook` cop. ([@fatkodima][])
|
66
|
+
* [#91](https://github.com/rubocop/rubocop-minitest/pull/91): Add new `Minitest/AssertInDelta` and `Minitest/RefuteInDelta` cops. ([@fatkodima][])
|
67
|
+
* [#89](https://github.com/rubocop/rubocop-minitest/pull/89): Add new `Minitest/TestMethodName` cop. ([@fatkodima][])
|
68
|
+
* [#83](https://github.com/rubocop/rubocop-minitest/pull/83): New cops `AssertPathExists` and `RefutePathExists` check for use of `assert_path_exists`/`refute_path_exists` instead of `assert(File.exist?(path))`/`refute(File.exist?(path))`. ([@fatkodima][])
|
69
|
+
* [#88](https://github.com/rubocop/rubocop-minitest/pull/88): Add new `Minitest/MultipleAssertions` cop. ([@fatkodima][])
|
70
|
+
* [#87](https://github.com/rubocop/rubocop-minitest/pull/87): Add new `Minitest/AssertSilent` cop. ([@fatkodima][])
|
71
|
+
* [#96](https://github.com/rubocop/rubocop-minitest/pull/96): Add new `Minitest/UnspecifiedException` cop. ([@fatkodima][])
|
72
|
+
* [#98](https://github.com/rubocop/rubocop-minitest/pull/98): Add new `Minitest/AssertOutput` cop. ([@fatkodima][])
|
73
|
+
* [#84](https://github.com/rubocop/rubocop-minitest/pull/84): New cops `AssertKindOf` and `RefuteKindOf` check for use of `assert_kind_of`/`refute_kind_of` instead of `assert(foo.kind_of?(Class))`/`refute(foo.kind_of?(Class))`. ([@fatkodima][])
|
74
|
+
* [#85](https://github.com/rubocop/rubocop-minitest/pull/85): Add autocorrect to `Rails/AssertEmptyLiteral` cop. ([@fatkodima][])
|
32
75
|
|
33
76
|
### Changes
|
34
77
|
|
35
|
-
* [#104](https://github.com/rubocop
|
78
|
+
* [#104](https://github.com/rubocop/rubocop-minitest/pull/104): Require RuboCop 0.87 or higher. ([@koic][])
|
36
79
|
|
37
80
|
## 0.9.0 (2020-04-13)
|
38
81
|
|
39
82
|
### Bug fixes
|
40
83
|
|
41
|
-
* [#75](https://github.com/rubocop
|
84
|
+
* [#75](https://github.com/rubocop/rubocop-minitest/issues/75): Fix a false negative for `Minitest/GlobalExpectations` when using global expectation methods with no arguments. ([@koic][])
|
42
85
|
|
43
86
|
### Changes
|
44
87
|
|
45
|
-
* [#73](https://github.com/rubocop
|
46
|
-
* [#77](https://github.com/rubocop
|
88
|
+
* [#73](https://github.com/rubocop/rubocop-minitest/issues/73): The Minitest department works on file names end with `_test.rb` by default. ([@koic][])
|
89
|
+
* [#77](https://github.com/rubocop/rubocop-minitest/pull/77): **(BREAKING)** Drop support for Ruby 2.3. ([@koic][])
|
47
90
|
|
48
91
|
## 0.8.1 (2020-04-06)
|
49
92
|
|
50
93
|
### Bug fixes
|
51
94
|
|
52
|
-
* [#72](https://github.com/rubocop
|
95
|
+
* [#72](https://github.com/rubocop/rubocop-minitest/pull/72): Fix some false negatives for `Minitest/GlobalExpectations`. ([@andrykonchin][])
|
53
96
|
|
54
97
|
## 0.8.0 (2020-03-24)
|
55
98
|
|
56
99
|
### New features
|
57
100
|
|
58
|
-
* [#66](https://github.com/rubocop
|
101
|
+
* [#66](https://github.com/rubocop/rubocop-minitest/issues/66): Support all expectations of `Minitest::Expectations` for `Minitest/GlobalExpectations` cop. ([@koic][])
|
59
102
|
|
60
103
|
### Bug fixes
|
61
104
|
|
62
|
-
* [#60](https://github.com/rubocop
|
63
|
-
* [#69](https://github.com/rubocop
|
64
|
-
* [#71](https://github.com/rubocop
|
105
|
+
* [#60](https://github.com/rubocop/rubocop-minitest/issues/60): Fix `Minitest/GlobalExpectations` autocorrection for chained methods. ([@tejasbubane][])
|
106
|
+
* [#69](https://github.com/rubocop/rubocop-minitest/pull/69): Fix a false negative for `Minitest/GlobalExpectations` cop when using a variable or a hash index for receiver. ([@koic][])
|
107
|
+
* [#71](https://github.com/rubocop/rubocop-minitest/pull/71): Fix a false negative for `Minitest/AssertEqual` when an argument is enclosed in redundant parentheses. ([@koic][])
|
65
108
|
|
66
109
|
## 0.7.0 (2020-03-09)
|
67
110
|
|
68
111
|
### New features
|
69
112
|
|
70
|
-
* [#60](https://github.com/rubocop
|
113
|
+
* [#60](https://github.com/rubocop/rubocop-minitest/issues/60): Add new cop `Minitest/GlobalExpectations` to check for deprecated global expectations. ([@tejasbubane][])
|
71
114
|
|
72
115
|
### Bug fixes
|
73
116
|
|
74
|
-
* [#58](https://github.com/rubocop
|
75
|
-
* [#59](https://github.com/rubocop
|
76
|
-
* [#61](https://github.com/rubocop
|
77
|
-
* [#62](https://github.com/rubocop
|
117
|
+
* [#58](https://github.com/rubocop/rubocop-minitest/pull/58): Fix a false negative for `Minitest/AssertMatch` and `Minitest/RefuteMatch` when an argument is enclosed in redundant parentheses. ([@koic][])
|
118
|
+
* [#59](https://github.com/rubocop/rubocop-minitest/pull/59): Fix a false negative for `Minitest/AssertRespondTo` and `Minitest/RefuteRespondTo` when an argument is enclosed in redundant parentheses. ([@koic][])
|
119
|
+
* [#61](https://github.com/rubocop/rubocop-minitest/pull/61): Fix a false negative for `Minitest/AssertInstanceOf` and `Minitest/RefuteInstanceOf` when an argument is enclosed in redundant parentheses. ([@koic][])
|
120
|
+
* [#62](https://github.com/rubocop/rubocop-minitest/pull/62): Fix a false negative for `Minitest/AssertEmpty` and `Minitest/RefuteEmpty` when an argument is enclosed in redundant parentheses. ([@koic][])
|
78
121
|
|
79
122
|
## 0.6.2 (2020-02-19)
|
80
123
|
|
81
124
|
### Bug fixes
|
82
125
|
|
83
|
-
* [#55](https://github.com/rubocop
|
126
|
+
* [#55](https://github.com/rubocop/rubocop-minitest/issues/55): Fix an error for `Minitest/AssertIncludes` when using local variable argument. ([@koic][])
|
84
127
|
|
85
128
|
## 0.6.1 (2020-02-18)
|
86
129
|
|
87
130
|
### Bug fixes
|
88
131
|
|
89
|
-
* [#52](https://github.com/rubocop
|
90
|
-
* [#52](https://github.com/rubocop
|
132
|
+
* [#52](https://github.com/rubocop/rubocop-minitest/issues/52): Make `Minitest/RefuteFalse` cop aware of `assert(!test)`. ([@koic][])
|
133
|
+
* [#52](https://github.com/rubocop/rubocop-minitest/issues/52): Fix a false negative for `Minitest/AssertIncludes` and `Minitest/RefuteIncludes` when an argument is enclosed in redundant parentheses. ([@koic][])
|
91
134
|
|
92
135
|
## 0.6.0 (2020-02-07)
|
93
136
|
|
94
137
|
### New features
|
95
138
|
|
96
|
-
* [#49](https://github.com/rubocop
|
139
|
+
* [#49](https://github.com/rubocop/rubocop-minitest/pull/49): New cops `AssertMatch` and `RefuteMatch` check for use of `assert_match`/`refute_match` instead of `assert(foo.match(bar))`/`refute(foo.match(bar))`. ([@fsateler][])
|
97
140
|
|
98
141
|
## 0.5.1 (2019-12-25)
|
99
142
|
|
100
143
|
### Bug fixes
|
101
144
|
|
102
|
-
* [#42](https://github.com/rubocop
|
145
|
+
* [#42](https://github.com/rubocop/rubocop-minitest/issues/42): Fix an incorrect autocorrect for some cops of `Minitest` department when using heredoc message. ([@koic][])
|
103
146
|
|
104
147
|
## 0.5.0 (2019-11-24)
|
105
148
|
|
106
149
|
### New features
|
107
150
|
|
108
|
-
* [#32](https://github.com/rubocop
|
151
|
+
* [#32](https://github.com/rubocop/rubocop-minitest/issues/32): Add new `Minitest/AssertEmptyLiteral` cop. ([@tejasbubane][])
|
109
152
|
|
110
153
|
## 0.4.1 (2019-11-10)
|
111
154
|
|
112
155
|
### Bug fixes
|
113
156
|
|
114
|
-
* [#39](https://github.com/rubocop
|
157
|
+
* [#39](https://github.com/rubocop/rubocop-minitest/issues/39): Fix an incorrect autocorrect for `Minitest/AssertRespondTo` and `Minitest/RefuteRespondTo` when using assertion method calling `respond_to` with receiver omitted. ([@koic][])
|
115
158
|
|
116
159
|
## 0.4.0 (2019-11-07)
|
117
160
|
|
118
161
|
### New features
|
119
162
|
|
120
|
-
* [#29](https://github.com/rubocop
|
121
|
-
* [#31](https://github.com/rubocop
|
122
|
-
* [#34](https://github.com/rubocop
|
123
|
-
* [#35](https://github.com/rubocop
|
163
|
+
* [#29](https://github.com/rubocop/rubocop-minitest/pull/29): Add new `Minitest/RefuteRespondTo` cop. ([@herwinw][])
|
164
|
+
* [#31](https://github.com/rubocop/rubocop-minitest/pull/31): Add new `Minitest/AssertEqual` cop. ([@herwinw][])
|
165
|
+
* [#34](https://github.com/rubocop/rubocop-minitest/pull/34): Add new `Minitest/AssertInstanceOf` cop. ([@abhaynikam][])
|
166
|
+
* [#35](https://github.com/rubocop/rubocop-minitest/pull/35): Add new `Minitest/RefuteInstanceOf` cop. ([@abhaynikam][])
|
124
167
|
|
125
168
|
### Bug fixes
|
126
169
|
|
127
|
-
* [#25](https://github.com/rubocop
|
170
|
+
* [#25](https://github.com/rubocop/rubocop-minitest/issues/25): Add `Enabled: true` to `Minitest` department config to suppress `Warning: Minitest does not support Enabled parameter`. ([@koic][])
|
128
171
|
|
129
172
|
## 0.3.0 (2019-10-13)
|
130
173
|
|
131
174
|
### New features
|
132
175
|
|
133
|
-
* [#15](https://github.com/rubocop
|
134
|
-
* [#18](https://github.com/rubocop
|
135
|
-
* [#20](https://github.com/rubocop
|
136
|
-
* [#21](https://github.com/rubocop
|
137
|
-
* [#27](https://github.com/rubocop
|
176
|
+
* [#15](https://github.com/rubocop/rubocop-minitest/pull/15): Add new `Minitest/RefuteIncludes` cop. ([@abhaynikam][])
|
177
|
+
* [#18](https://github.com/rubocop/rubocop-minitest/pull/18): Add new `Minitest/RefuteFalse` cop. ([@duduribeiro][])
|
178
|
+
* [#20](https://github.com/rubocop/rubocop-minitest/pull/20): Add new `Minitest/RefuteEmpty` cop. ([@abhaynikam][])
|
179
|
+
* [#21](https://github.com/rubocop/rubocop-minitest/pull/21): Add new `Minitest/RefuteEqual` cop. ([@duduribeiro][])
|
180
|
+
* [#27](https://github.com/rubocop/rubocop-minitest/pull/27): Add new `Minitest/AssertRespondTo` cop. ([@duduribeiro][])
|
138
181
|
|
139
182
|
### Bug fixes
|
140
183
|
|
141
|
-
* [#19](https://github.com/rubocop
|
184
|
+
* [#19](https://github.com/rubocop/rubocop-minitest/pull/19): Fix a false negative for `Minitest/AssertIncludes` when using `include` method in arguments of `assert` method. ([@abhaynikam][])
|
142
185
|
|
143
186
|
## 0.2.1 (2019-09-24)
|
144
187
|
|
145
188
|
### Bug fixes
|
146
189
|
|
147
|
-
* [#13](https://github.com/rubocop
|
190
|
+
* [#13](https://github.com/rubocop/rubocop-minitest/issues/13): Fix the execution target specified in `Include` parameter. ([@koic][])
|
148
191
|
|
149
192
|
## 0.2.0 (2019-09-21)
|
150
193
|
|
151
194
|
### New features
|
152
195
|
|
153
|
-
* [#11](https://github.com/rubocop
|
154
|
-
* [#8](https://github.com/rubocop
|
155
|
-
* [#9](https://github.com/rubocop
|
156
|
-
* [#10](https://github.com/rubocop
|
196
|
+
* [#11](https://github.com/rubocop/rubocop-minitest/pull/11): Add new `Minitest/RefuteNil` cop. ([@tejasbubane][])
|
197
|
+
* [#8](https://github.com/rubocop/rubocop-minitest/pull/8): Add new `Minitest/AssertTruthy` cop. ([@abhaynikam][])
|
198
|
+
* [#9](https://github.com/rubocop/rubocop-minitest/pull/9): Add new `Minitest/AssertIncludes` cop. ([@abhaynikam][])
|
199
|
+
* [#10](https://github.com/rubocop/rubocop-minitest/pull/10): Add new `Minitest/AssertEmpty` cop. ([@abhaynikam][])
|
157
200
|
|
158
201
|
## 0.1.0 (2019-09-01)
|
159
202
|
|
160
203
|
### New features
|
161
204
|
|
162
205
|
* Create RuboCop Minitest gem. ([@koic][])
|
163
|
-
* [#6](https://github.com/rubocop
|
206
|
+
* [#6](https://github.com/rubocop/rubocop-minitest/pull/6): Add new `Minitest/AssertNil` cop. ([@duduribeiro][])
|
164
207
|
|
165
208
|
[@koic]: https://github.com/koic
|
166
209
|
[@duduribeiro]: https://github.com/duduribeiro
|
@@ -171,3 +214,5 @@
|
|
171
214
|
[@andrykonchin]: https://github.com/andrykonchin
|
172
215
|
[@fatkodima]: https://github.com/fatkodima
|
173
216
|
[@tsmmark]: https://github.com/tsmmark
|
217
|
+
[@cstyles]: https://github.com/cstyles
|
218
|
+
[@ghiculescu]: https://github.com/ghiculescu
|
data/CONTRIBUTING.md
CHANGED
@@ -49,18 +49,18 @@ $ rubocop -V
|
|
49
49
|
Here are a few examples:
|
50
50
|
|
51
51
|
```
|
52
|
-
* [#716](https://github.com/rubocop
|
52
|
+
* [#716](https://github.com/rubocop/rubocop-minitest/issues/716): Fixed a regression in the auto-correction logic of `MethodDefParentheses`. ([@bbatsov][])
|
53
53
|
* New cop `ElseLayout` checks for odd arrangement of code in the `else` branch of a conditional expression. ([@bbatsov][])
|
54
54
|
```
|
55
55
|
|
56
56
|
* Mark it up in [Markdown syntax][6].
|
57
57
|
* The entry line should start with `* ` (an asterisk and a space).
|
58
|
-
* If the change has a related GitHub issue (e.g. a bug fix for a reported issue), put a link to the issue as `[#123](https://github.com/rubocop
|
58
|
+
* If the change has a related GitHub issue (e.g. a bug fix for a reported issue), put a link to the issue as `[#123](https://github.com/rubocop/rubocop-minitest/issues/123): `.
|
59
59
|
* Describe the brief of the change. The sentence should end with a punctuation.
|
60
60
|
* At the end of the entry, add an implicit link to your GitHub user page as `([@username][])`.
|
61
61
|
* If this is your first contribution to RuboCop project, add a link definition for the implicit link to the bottom of the changelog as `[@username]: https://github.com/username`.
|
62
62
|
|
63
|
-
[1]: https://github.com/rubocop
|
63
|
+
[1]: https://github.com/rubocop/rubocop-minitest/issues
|
64
64
|
[2]: https://www.gun.io/blog/how-to-github-fork-branch-and-pull-request
|
65
65
|
[3]: https://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html
|
66
66
|
[4]: https://help.github.com/articles/about-pull-requests
|
data/Gemfile
CHANGED
data/LICENSE.txt
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
The MIT License (MIT)
|
2
2
|
|
3
|
-
Copyright (c) 2019-
|
3
|
+
Copyright (c) 2019-2021 Bozhidar Batsov, Jonas Arvidsson, Koichi ITO
|
4
4
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
data/README.md
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
# RuboCop Minitest
|
2
2
|
|
3
3
|
[![Gem Version](https://badge.fury.io/rb/rubocop-minitest.svg)](https://badge.fury.io/rb/rubocop-minitest)
|
4
|
-
[![CircleCI](https://circleci.com/gh/rubocop
|
4
|
+
[![CircleCI](https://circleci.com/gh/rubocop/rubocop-minitest.svg?style=svg)](https://circleci.com/gh/rubocop/rubocop-minitest)
|
5
5
|
|
6
|
-
A [RuboCop](https://github.com/rubocop
|
6
|
+
A [RuboCop](https://github.com/rubocop/rubocop) extension focused on enforcing Minitest best practices and coding conventions.
|
7
7
|
The library is based on the guidelines outlined in the community [Minitest Style Guide](https://minitest.rubystyle.guide).
|
8
8
|
|
9
9
|
## Installation
|
@@ -81,14 +81,14 @@ You can read a lot more about RuboCop Minitest in its [official docs](https://do
|
|
81
81
|
|
82
82
|
If you use RuboCop Minitest in your project, you can include one of these badges in your readme to let people know that your code is written following the community Minitest Style Guide.
|
83
83
|
|
84
|
-
[![Minitest Style Guide](https://img.shields.io/badge/code_style-rubocop-brightgreen.svg)](https://github.com/rubocop
|
84
|
+
[![Minitest Style Guide](https://img.shields.io/badge/code_style-rubocop-brightgreen.svg)](https://github.com/rubocop/rubocop-minitest)
|
85
85
|
|
86
86
|
[![Minitest Style Guide](https://img.shields.io/badge/code_style-community-brightgreen.svg)](https://minitest.rubystyle.guide)
|
87
87
|
|
88
88
|
Here are the Markdown snippets for the two badges:
|
89
89
|
|
90
90
|
``` markdown
|
91
|
-
[![Minitest Style Guide](https://img.shields.io/badge/code_style-rubocop-brightgreen.svg)](https://github.com/rubocop
|
91
|
+
[![Minitest Style Guide](https://img.shields.io/badge/code_style-rubocop-brightgreen.svg)](https://github.com/rubocop/rubocop-minitest)
|
92
92
|
|
93
93
|
[![Minitest Style Guide](https://img.shields.io/badge/code_style-community-brightgreen.svg)](https://minitest.rubystyle.guide)
|
94
94
|
```
|
data/Rakefile
CHANGED
data/bin/console
CHANGED
data/config/default.yml
CHANGED
@@ -15,7 +15,7 @@ Minitest/AssertEmptyLiteral:
|
|
15
15
|
Enabled: true
|
16
16
|
SafeAutoCorrect: false
|
17
17
|
VersionAdded: '0.5'
|
18
|
-
VersionChanged: '0.
|
18
|
+
VersionChanged: '0.11'
|
19
19
|
|
20
20
|
Minitest/AssertEqual:
|
21
21
|
Description: 'This cop enforces the test to use `assert_equal` instead of using `assert(expected == actual)`.'
|
@@ -54,7 +54,7 @@ Minitest/AssertInstanceOf:
|
|
54
54
|
|
55
55
|
Minitest/AssertKindOf:
|
56
56
|
Description: 'This cop enforces the test to use `assert_kind_of(Class, object)` over `assert(object.kind_of?(Class))`'
|
57
|
-
StyleGuide: 'https://github.com/rubocop
|
57
|
+
StyleGuide: 'https://github.com/rubocop/minitest-style-guide#assert-kind-of'
|
58
58
|
Enabled: 'pending'
|
59
59
|
VersionAdded: '0.10'
|
60
60
|
|
@@ -84,7 +84,7 @@ Minitest/AssertRespondTo:
|
|
84
84
|
|
85
85
|
Minitest/AssertSilent:
|
86
86
|
Description: "This cop enforces the test to use `assert_silent { ... }` instead of using `assert_output('', '') { ... }`."
|
87
|
-
StyleGuide: 'https://github.com/rubocop
|
87
|
+
StyleGuide: 'https://github.com/rubocop/minitest-style-guide#assert-silent'
|
88
88
|
Enabled: 'pending'
|
89
89
|
VersionAdded: '0.10'
|
90
90
|
|
@@ -94,6 +94,12 @@ Minitest/AssertTruthy:
|
|
94
94
|
Enabled: true
|
95
95
|
VersionAdded: '0.2'
|
96
96
|
|
97
|
+
Minitest/AssertWithExpectedArgument:
|
98
|
+
Description: 'This cop tries to detect when a user accidentally used `assert` when they meant to use `assert_equal`.'
|
99
|
+
Enabled: pending
|
100
|
+
Safe: false
|
101
|
+
VersionAdded: '0.11'
|
102
|
+
|
97
103
|
Minitest/GlobalExpectations:
|
98
104
|
Description: 'This cop checks for deprecated global expectations.'
|
99
105
|
StyleGuide: 'https://minitest.rubystyle.guide#global-expectations'
|
@@ -112,6 +118,11 @@ Minitest/MultipleAssertions:
|
|
112
118
|
VersionAdded: '0.10'
|
113
119
|
Max: 3
|
114
120
|
|
121
|
+
Minitest/NoAssertions:
|
122
|
+
Description: 'This cop checks for at least one assertion (or flunk) in tests.'
|
123
|
+
Enabled: false
|
124
|
+
VersionAdded: '0.12'
|
125
|
+
|
115
126
|
Minitest/RefuteEmpty:
|
116
127
|
Description: 'This cop enforces to use `refute_empty` instead of using `refute(object.empty?)`.'
|
117
128
|
StyleGuide: 'https://minitest.rubystyle.guide#refute-empty'
|
@@ -156,7 +167,7 @@ Minitest/RefuteInstanceOf:
|
|
156
167
|
|
157
168
|
Minitest/RefuteKindOf:
|
158
169
|
Description: 'This cop enforces the test to use `refute_kind_of(Class, object)` over `refute(object.kind_of?(Class))`.'
|
159
|
-
StyleGuide: 'https://github.com/rubocop
|
170
|
+
StyleGuide: 'https://github.com/rubocop/minitest-style-guide#refute-kind-of'
|
160
171
|
Enabled: 'pending'
|
161
172
|
VersionAdded: '0.10'
|
162
173
|
|