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.
Files changed (83) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +3 -3
  3. data/.github/ISSUE_TEMPLATE/bug_report.md +5 -1
  4. data/.rubocop.yml +4 -1
  5. data/CHANGELOG.md +96 -51
  6. data/CONTRIBUTING.md +3 -3
  7. data/Gemfile +2 -2
  8. data/LICENSE.txt +1 -1
  9. data/README.md +4 -4
  10. data/Rakefile +1 -1
  11. data/bin/console +2 -0
  12. data/config/default.yml +15 -4
  13. data/docs/antora.yml +1 -1
  14. data/docs/modules/ROOT/pages/cops.adoc +2 -0
  15. data/docs/modules/ROOT/pages/cops_minitest.adoc +78 -7
  16. data/docs/modules/ROOT/pages/index.adoc +1 -1
  17. data/legacy-docs/cops_minitest.md +16 -16
  18. data/legacy-docs/index.md +1 -1
  19. data/lib/rubocop/cop/minitest/assert_empty.rb +1 -1
  20. data/lib/rubocop/cop/minitest/assert_empty_literal.rb +12 -16
  21. data/lib/rubocop/cop/minitest/assert_equal.rb +1 -1
  22. data/lib/rubocop/cop/minitest/assert_in_delta.rb +4 -1
  23. data/lib/rubocop/cop/minitest/assert_includes.rb +1 -1
  24. data/lib/rubocop/cop/minitest/assert_instance_of.rb +1 -1
  25. data/lib/rubocop/cop/minitest/assert_kind_of.rb +1 -1
  26. data/lib/rubocop/cop/minitest/assert_match.rb +1 -1
  27. data/lib/rubocop/cop/minitest/assert_nil.rb +5 -11
  28. data/lib/rubocop/cop/minitest/assert_output.rb +1 -1
  29. data/lib/rubocop/cop/minitest/assert_path_exists.rb +6 -12
  30. data/lib/rubocop/cop/minitest/assert_respond_to.rb +1 -1
  31. data/lib/rubocop/cop/minitest/assert_silent.rb +8 -6
  32. data/lib/rubocop/cop/minitest/assert_truthy.rb +5 -11
  33. data/lib/rubocop/cop/minitest/assert_with_expected_argument.rb +41 -0
  34. data/lib/rubocop/cop/minitest/assertion_in_lifecycle_hook.rb +1 -1
  35. data/lib/rubocop/cop/minitest/global_expectations.rb +6 -7
  36. data/lib/rubocop/cop/minitest/literal_as_actual_argument.rb +15 -14
  37. data/lib/rubocop/cop/minitest/multiple_assertions.rb +2 -2
  38. data/lib/rubocop/cop/minitest/no_assertions.rb +48 -0
  39. data/lib/rubocop/cop/minitest/refute_empty.rb +1 -1
  40. data/lib/rubocop/cop/minitest/refute_equal.rb +6 -7
  41. data/lib/rubocop/cop/minitest/refute_false.rb +15 -22
  42. data/lib/rubocop/cop/minitest/refute_in_delta.rb +4 -1
  43. data/lib/rubocop/cop/minitest/refute_includes.rb +1 -1
  44. data/lib/rubocop/cop/minitest/refute_instance_of.rb +1 -1
  45. data/lib/rubocop/cop/minitest/refute_kind_of.rb +1 -1
  46. data/lib/rubocop/cop/minitest/refute_match.rb +1 -1
  47. data/lib/rubocop/cop/minitest/refute_nil.rb +4 -8
  48. data/lib/rubocop/cop/minitest/refute_path_exists.rb +6 -12
  49. data/lib/rubocop/cop/minitest/refute_respond_to.rb +1 -1
  50. data/lib/rubocop/cop/minitest/test_method_name.rb +18 -8
  51. data/lib/rubocop/cop/minitest/unspecified_exception.rb +1 -1
  52. data/lib/rubocop/cop/minitest_cops.rb +2 -0
  53. data/lib/rubocop/cop/mixin/in_delta_mixin.rb +5 -15
  54. data/lib/rubocop/cop/mixin/minitest_cop_rule.rb +12 -12
  55. data/lib/rubocop/cop/mixin/minitest_exploration_helpers.rb +20 -3
  56. data/lib/rubocop/minitest/version.rb +1 -1
  57. data/mkdocs.yml +2 -2
  58. data/relnotes/v0.1.0.md +1 -1
  59. data/relnotes/v0.10.0.md +12 -12
  60. data/relnotes/v0.10.1.md +1 -1
  61. data/relnotes/v0.10.2.md +1 -1
  62. data/relnotes/v0.10.3.md +5 -0
  63. data/relnotes/v0.11.0.md +16 -0
  64. data/relnotes/v0.11.1.md +5 -0
  65. data/relnotes/v0.12.0.md +10 -0
  66. data/relnotes/v0.12.1.md +5 -0
  67. data/relnotes/v0.2.0.md +4 -4
  68. data/relnotes/v0.2.1.md +1 -1
  69. data/relnotes/v0.3.0.md +6 -6
  70. data/relnotes/v0.4.0.md +5 -5
  71. data/relnotes/v0.4.1.md +1 -1
  72. data/relnotes/v0.5.0.md +1 -1
  73. data/relnotes/v0.5.1.md +1 -1
  74. data/relnotes/v0.6.0.md +1 -1
  75. data/relnotes/v0.6.1.md +2 -2
  76. data/relnotes/v0.6.2.md +1 -1
  77. data/relnotes/v0.7.0.md +5 -5
  78. data/relnotes/v0.8.0.md +4 -4
  79. data/relnotes/v0.8.1.md +1 -1
  80. data/relnotes/v0.9.0.md +3 -3
  81. data/rubocop-minitest.gemspec +5 -5
  82. data/tasks/cops_documentation.rake +9 -11
  83. metadata +17 -10
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2ad49b7b1f0f0d916cb20400f58ea616d13663e99a57719d9b4a8a373a859a5d
4
- data.tar.gz: c69990256d72a503f7bf072273fe077f7c2eea32fd6c7f13b2f2fe83f18c8780
3
+ metadata.gz: 3e7a3871e612b7ff9a9fd9c5c83bb092ea6097f6b4838246b45346dd4ccc0d4a
4
+ data.tar.gz: 1ba5c7ebe8764918e623fc45a5dc198700172ea5892db6744cbfd01eaf449023
5
5
  SHA512:
6
- metadata.gz: c6899f78263d3d2728d5f0074d36c6813b8392d910524193f871ef1313af59fc78270ddb7ffa8b5b11c83c6c6f9bc6f0a8e57203dd54ffb3d81f1b036b025913
7
- data.tar.gz: c402e470711d7432317c48c19c64e3b27c701855ceea1557abcf8418e6dd5ecfa33b0433372f9a73fa58ab956989aed7fbdb6b8f227e16b32272d9813d29c5d3
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
- 0.74.0 (using Parser 2.6.4.0, running on ruby 2.6.4 x86_64-darwin17)
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.4
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-hq/rubocop-minitest/issues/113): This PR fixes an error for `Minitest/AssertEqual` and some cops when using `assert` with block argument. ([@koic][])
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-hq/rubocop-minitest/issues/106): Fix an error for `Minitest/AssertOutput` when using gvar at top level. ([@koic][])
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-hq/rubocop-minitest/pull/92): Add new `Minitest/LiteralAsActualArgument` cop. ([@fatkodima][], [@tsmmark][])
22
- * [#95](https://github.com/rubocop-hq/rubocop-minitest/pull/95): Add new `Minitest/AssertionInLifecycleHook` cop. ([@fatkodima][])
23
- * [#91](https://github.com/rubocop-hq/rubocop-minitest/pull/91): Add new `Minitest/AssertInDelta` and `Minitest/RefuteInDelta` cops. ([@fatkodima][])
24
- * [#89](https://github.com/rubocop-hq/rubocop-minitest/pull/89): Add new `Minitest/TestMethodName` cop. ([@fatkodima][])
25
- * [#83](https://github.com/rubocop-hq/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][])
26
- * [#88](https://github.com/rubocop-hq/rubocop-minitest/pull/88): Add new `Minitest/MultipleAssertions` cop. ([@fatkodima][])
27
- * [#87](https://github.com/rubocop-hq/rubocop-minitest/pull/87): Add new `Minitest/AssertSilent` cop. ([@fatkodima][])
28
- * [#96](https://github.com/rubocop-hq/rubocop-minitest/pull/96): Add new `Minitest/UnspecifiedException` cop. ([@fatkodima][])
29
- * [#98](https://github.com/rubocop-hq/rubocop-minitest/pull/98): Add new `Minitest/AssertOutput` cop. ([@fatkodima][])
30
- * [#84](https://github.com/rubocop-hq/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][])
31
- * [#85](https://github.com/rubocop-hq/rubocop-minitest/pull/85): Add autocorrect to `Rails/AssertEmptyLiteral` cop. ([@fatkodima][])
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-hq/rubocop-minitest/pull/104): Require RuboCop 0.87 or higher. ([@koic][])
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-hq/rubocop-minitest/issues/75): Fix a false negative for `Minitest/GlobalExpectations` when using global expectation methods with no arguments. ([@koic][])
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-hq/rubocop-minitest/issues/73): The Minitest department works on file names end with `_test.rb` by default. ([@koic][])
46
- * [#77](https://github.com/rubocop-hq/rubocop-minitest/pull/77): **(BREAKING)** Drop support for Ruby 2.3. ([@koic][])
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-hq/rubocop-minitest/pull/72): Fix some false negatives for `Minitest/GlobalExpectations`. ([@andrykonchin][])
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-hq/rubocop-minitest/issues/66): Support all expectations of `Minitest::Expectations` for `Minitest/GlobalExpectations` cop. ([@koic][])
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-hq/rubocop-minitest/issues/60): Fix `Minitest/GlobalExpectations` autocorrection for chained methods. ([@tejasbubane][])
63
- * [#69](https://github.com/rubocop-hq/rubocop-minitest/pull/69): Fix a false negative for `Minitest/GlobalExpectations` cop when using a variable or a hash index for receiver. ([@koic][])
64
- * [#71](https://github.com/rubocop-hq/rubocop-minitest/pull/71): Fix a false negative for `Minitest/AssertEqual` when an argument is enclosed in redundant parentheses. ([@koic][])
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-hq/rubocop-minitest/issues/60): Add new cop `Minitest/GlobalExpectations` to check for deprecated global expectations. ([@tejasbubane][])
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-hq/rubocop-minitest/pull/58): Fix a false negative for `Minitest/AssertMatch` and `Minitest/RefuteMatch` when an argument is enclosed in redundant parentheses. ([@koic][])
75
- * [#59](https://github.com/rubocop-hq/rubocop-minitest/pull/59): Fix a false negative for `Minitest/AssertRespondTo` and `Minitest/RefuteRespondTo` when an argument is enclosed in redundant parentheses. ([@koic][])
76
- * [#61](https://github.com/rubocop-hq/rubocop-minitest/pull/61): Fix a false negative for `Minitest/AssertInstanceOf` and `Minitest/RefuteInstanceOf` when an argument is enclosed in redundant parentheses. ([@koic][])
77
- * [#62](https://github.com/rubocop-hq/rubocop-minitest/pull/62): Fix a false negative for `Minitest/AssertEmpty` and `Minitest/RefuteEmpty` when an argument is enclosed in redundant parentheses. ([@koic][])
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-hq/rubocop-minitest/issues/55): Fix an error for `Minitest/AssertIncludes` when using local variable argument. ([@koic][])
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-hq/rubocop-minitest/issues/52): Make `Minitest/RefuteFalse` cop aware of `assert(!test)`. ([@koic][])
90
- * [#52](https://github.com/rubocop-hq/rubocop-minitest/issues/52): Fix a false negative for `Minitest/AssertIncludes` and `Minitest/RefuteIncludes` when an argument is enclosed in redundant parentheses. ([@koic][])
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-hq/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][])
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-hq/rubocop-minitest/issues/42): Fix an incorrect autocorrect for some cops of `Minitest` department when using heredoc message. ([@koic][])
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-hq/rubocop-minitest/issues/32): Add new `Minitest/AssertEmptyLiteral` cop. ([@tejasbubane][])
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-hq/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][])
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-hq/rubocop-minitest/pull/29): Add new `Minitest/RefuteRespondTo` cop. ([@herwinw][])
121
- * [#31](https://github.com/rubocop-hq/rubocop-minitest/pull/31): Add new `Minitest/AssertEqual` cop. ([@herwinw][])
122
- * [#34](https://github.com/rubocop-hq/rubocop-minitest/pull/34): Add new `Minitest/AssertInstanceOf` cop. ([@abhaynikam][])
123
- * [#35](https://github.com/rubocop-hq/rubocop-minitest/pull/35): Add new `Minitest/RefuteInstanceOf` cop. ([@abhaynikam][])
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-hq/rubocop-minitest/issues/25): Add `Enabled: true` to `Minitest` department config to suppress `Warning: Minitest does not support Enabled parameter`. ([@koic][])
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-hq/rubocop-minitest/pull/15): Add new `Minitest/RefuteIncludes` cop. ([@abhaynikam][])
134
- * [#18](https://github.com/rubocop-hq/rubocop-minitest/pull/18): Add new `Minitest/RefuteFalse` cop. ([@duduribeiro][])
135
- * [#20](https://github.com/rubocop-hq/rubocop-minitest/pull/20): Add new `Minitest/RefuteEmpty` cop. ([@abhaynikam][])
136
- * [#21](https://github.com/rubocop-hq/rubocop-minitest/pull/21): Add new `Minitest/RefuteEqual` cop. ([@duduribeiro][])
137
- * [#27](https://github.com/rubocop-hq/rubocop-minitest/pull/27): Add new `Minitest/AssertRespondTo` cop. ([@duduribeiro][])
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-hq/rubocop-minitest/pull/19): Fix a false negative for `Minitest/AssertIncludes` when using `include` method in arguments of `assert` method. ([@abhaynikam][])
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-hq/rubocop-minitest/issues/13): Fix the execution target specified in `Include` parameter. ([@koic][])
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-hq/rubocop-minitest/pull/11): Add new `Minitest/RefuteNil` cop. ([@tejasbubane][])
154
- * [#8](https://github.com/rubocop-hq/rubocop-minitest/pull/8): Add new `Minitest/AssertTruthy` cop. ([@abhaynikam][])
155
- * [#9](https://github.com/rubocop-hq/rubocop-minitest/pull/9): Add new `Minitest/AssertIncludes` cop. ([@abhaynikam][])
156
- * [#10](https://github.com/rubocop-hq/rubocop-minitest/pull/10): Add new `Minitest/AssertEmpty` cop. ([@abhaynikam][])
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-hq/rubocop-minitest/pull/6): Add new `Minitest/AssertNil` cop. ([@duduribeiro][])
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-hq/rubocop-minitest/issues/716): Fixed a regression in the auto-correction logic of `MethodDefParentheses`. ([@bbatsov][])
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-hq/rubocop-minitest/issues/123): `.
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-hq/rubocop-minitest/issues
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
@@ -8,6 +8,6 @@ gemspec
8
8
 
9
9
  gem 'bump', require: false
10
10
  gem 'rake'
11
- gem 'rubocop', github: 'rubocop-hq/rubocop'
12
- gem 'rubocop-performance', '~> 1.9.0'
11
+ gem 'rubocop', github: 'rubocop/rubocop'
12
+ gem 'rubocop-performance', '~> 1.10.0'
13
13
  gem 'yard', '~> 0.9'
data/LICENSE.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2019-2020 Bozhidar Batsov, Jonas Arvidsson, Koichi ITO
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-hq/rubocop-minitest.svg?style=svg)](https://circleci.com/gh/rubocop-hq/rubocop-minitest)
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-hq/rubocop) extension focused on enforcing Minitest best practices and coding conventions.
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-hq/rubocop-minitest)
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-hq/rubocop-minitest)
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
@@ -61,7 +61,7 @@ task :new_cop, [:cop] do |_task, args|
61
61
  end
62
62
 
63
63
  def bump_minor_version
64
- major, minor, _patch = RuboCop::Minitest::VERSION.split('.')
64
+ major, minor, _patch = RuboCop::Minitest::Version::STRING.split('.')
65
65
 
66
66
  "#{major}.#{minor.succ}"
67
67
  end
data/bin/console CHANGED
@@ -2,6 +2,8 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  require 'bundler/setup'
5
+ require 'pathname'
6
+ require 'yaml'
5
7
  require 'rubocop/minitest'
6
8
 
7
9
  # You can add fixtures and/or initialization code here to make experimenting
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.10'
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-hq/minitest-style-guide#assert-kind-of'
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-hq/minitest-style-guide#assert-silent'
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-hq/minitest-style-guide#refute-kind-of'
170
+ StyleGuide: 'https://github.com/rubocop/minitest-style-guide#refute-kind-of'
160
171
  Enabled: 'pending'
161
172
  VersionAdded: '0.10'
162
173