rubocop-minitest 0.10.0 → 0.11.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (63) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +18 -0
  3. data/.github/ISSUE_TEMPLATE/bug_report.md +5 -1
  4. data/.rubocop.yml +4 -0
  5. data/.rubocop_todo.yml +8 -7
  6. data/CHANGELOG.md +90 -49
  7. data/CONTRIBUTING.md +3 -3
  8. data/Gemfile +2 -2
  9. data/LICENSE.txt +1 -1
  10. data/README.md +18 -2
  11. data/Rakefile +1 -1
  12. data/bin/console +2 -0
  13. data/config/default.yml +10 -4
  14. data/docs/antora.yml +1 -1
  15. data/docs/modules/ROOT/pages/cops.adoc +13 -1
  16. data/docs/modules/ROOT/pages/cops_minitest.adoc +47 -8
  17. data/docs/modules/ROOT/pages/index.adoc +1 -1
  18. data/legacy-docs/cops_minitest.md +16 -16
  19. data/legacy-docs/index.md +1 -1
  20. data/lib/rubocop/cop/minitest/assert_empty_literal.rb +9 -8
  21. data/lib/rubocop/cop/minitest/assert_in_delta.rb +2 -0
  22. data/lib/rubocop/cop/minitest/assert_nil.rb +1 -0
  23. data/lib/rubocop/cop/minitest/assert_path_exists.rb +1 -0
  24. data/lib/rubocop/cop/minitest/assert_truthy.rb +1 -0
  25. data/lib/rubocop/cop/minitest/assert_with_expected_argument.rb +41 -0
  26. data/lib/rubocop/cop/minitest/global_expectations.rb +2 -0
  27. data/lib/rubocop/cop/minitest/literal_as_actual_argument.rb +1 -0
  28. data/lib/rubocop/cop/minitest/refute_equal.rb +2 -1
  29. data/lib/rubocop/cop/minitest/refute_false.rb +1 -0
  30. data/lib/rubocop/cop/minitest/refute_in_delta.rb +2 -0
  31. data/lib/rubocop/cop/minitest/refute_nil.rb +1 -0
  32. data/lib/rubocop/cop/minitest/refute_path_exists.rb +1 -0
  33. data/lib/rubocop/cop/minitest/test_method_name.rb +10 -1
  34. data/lib/rubocop/cop/minitest_cops.rb +1 -0
  35. data/lib/rubocop/cop/mixin/minitest_cop_rule.rb +2 -1
  36. data/lib/rubocop/cop/mixin/minitest_exploration_helpers.rb +14 -1
  37. data/lib/rubocop/minitest/version.rb +8 -1
  38. data/mkdocs.yml +2 -2
  39. data/relnotes/v0.1.0.md +1 -1
  40. data/relnotes/v0.10.0.md +12 -12
  41. data/relnotes/v0.10.1.md +5 -0
  42. data/relnotes/v0.10.2.md +5 -0
  43. data/relnotes/v0.10.3.md +5 -0
  44. data/relnotes/v0.11.0.md +16 -0
  45. data/relnotes/v0.11.1.md +5 -0
  46. data/relnotes/v0.2.0.md +4 -4
  47. data/relnotes/v0.2.1.md +1 -1
  48. data/relnotes/v0.3.0.md +6 -6
  49. data/relnotes/v0.4.0.md +5 -5
  50. data/relnotes/v0.4.1.md +1 -1
  51. data/relnotes/v0.5.0.md +1 -1
  52. data/relnotes/v0.5.1.md +1 -1
  53. data/relnotes/v0.6.0.md +1 -1
  54. data/relnotes/v0.6.1.md +2 -2
  55. data/relnotes/v0.6.2.md +1 -1
  56. data/relnotes/v0.7.0.md +5 -5
  57. data/relnotes/v0.8.0.md +4 -4
  58. data/relnotes/v0.8.1.md +1 -1
  59. data/relnotes/v0.9.0.md +3 -3
  60. data/rubocop-minitest.gemspec +6 -6
  61. data/tasks/cops_documentation.rake +15 -295
  62. data/tasks/cut_release.rake +1 -1
  63. metadata +26 -14
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ba38b8b45ed71a06486486456dbda0e2d833f58ccf59fc7e22ecb3a1d4ec2dd7
4
- data.tar.gz: 5f5260b7699852144213e044386662b3168eff83068ee88257df478fd79c7314
3
+ metadata.gz: 2581fbadb9e19f8827cc513bb86e86b431295047c2f37401416793de014f1d52
4
+ data.tar.gz: 8dc80007c469db266b85d99e672a47e1f7c4c245dcbc713896232afc87a97818
5
5
  SHA512:
6
- metadata.gz: accc29f0bf8c2c80404a0777122446bea1ed7a6d57809b68b4ca21f66aedecdc161c3f29dd0777a61a2bccda158da3cb20892470994d335a4da63a2c09fbc80a
7
- data.tar.gz: 8c3c5b4f73bd953c7ced000471c3e91645e36c240d7e73f04631487344c3a9e14152b2c83b3d6dccdf3530936007deb4e3dbc819c6b28e86a34ef5b821802375
6
+ metadata.gz: f9e6da24df8a6dbd427a26f00a09a4a14eed05fccfd6bfc8c31e9195237f999a3c822fda7ada6c64467d07f2542a981d1b7851e6bd2ab04cf4ac4c7c343bdb47
7
+ data.tar.gz: debd9d0030d135360d6019e85cfdd5dd090ed50781f3c68cf4b8687f6e7ac8dc917124b866298159858fe359a1017f177b61269b310ac5aed76b8dade6577f93
data/.circleci/config.yml CHANGED
@@ -20,9 +20,24 @@ jobs:
20
20
  - run: bundle install
21
21
  - run: bundle exec rake
22
22
 
23
+ # Miscellaneous tasks
24
+ documentation-checks:
25
+ docker:
26
+ - image: circleci/ruby
27
+ steps:
28
+ - checkout
29
+ - run: bundle install
30
+ - run:
31
+ name: Check documentation syntax
32
+ command: bundle exec rake documentation_syntax_check
33
+ - run:
34
+ name: Build documentation and verify that doc files are in sync
35
+ command: bundle exec rake verify_cops_documentation
36
+
23
37
  workflows:
24
38
  build:
25
39
  jobs:
40
+ - documentation-checks
26
41
  - rake_default:
27
42
  name: Ruby 2.4
28
43
  image: circleci/ruby:2.4
@@ -35,6 +50,9 @@ workflows:
35
50
  - rake_default:
36
51
  name: Ruby 2.7
37
52
  image: circleci/ruby:2.7
53
+ - rake_default:
54
+ name: Ruby 3.0
55
+ image: circleci/ruby:3.0
38
56
  - rake_default:
39
57
  name: Ruby HEAD
40
58
  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
@@ -10,6 +10,10 @@ require:
10
10
  AllCops:
11
11
  NewCops: enable
12
12
  TargetRubyVersion: 2.4
13
+ SuggestExtensions: false
14
+
15
+ InternalAffairs/NodeMatcherDirective:
16
+ Enabled: false
13
17
 
14
18
  Naming/PredicateName:
15
19
  # Method define macros for dynamically generated method.
data/.rubocop_todo.yml CHANGED
@@ -1,16 +1,17 @@
1
1
  # This configuration was generated by
2
2
  # `rubocop --auto-gen-config`
3
- # on 2019-12-21 01:15:41 +0900 using RuboCop version 0.78.0.
3
+ # on 2020-10-29 02:01:16 UTC using RuboCop version 1.0.0.
4
4
  # The point is for the user to remove these configuration records
5
5
  # one by one as the offenses are removed from the code base.
6
6
  # Note that changes in the inspected code, or installation of new
7
7
  # versions of RuboCop, may require this file to be generated again.
8
8
 
9
- # Offense count: 2
10
- Metrics/AbcSize:
11
- Max: 17
12
-
13
- # Offense count: 19
14
- # Configuration parameters: CountComments, ExcludedMethods.
9
+ # Offense count: 22
10
+ # Configuration parameters: CountComments, CountAsOne, ExcludedMethods.
15
11
  Metrics/MethodLength:
16
12
  Max: 14
13
+
14
+ # Offense count: 1
15
+ Style/DocumentDynamicEvalDefinition:
16
+ Exclude:
17
+ - 'lib/rubocop/cop/mixin/minitest_cop_rule.rb'
data/CHANGELOG.md CHANGED
@@ -2,153 +2,192 @@
2
2
 
3
3
  ## master (unreleased)
4
4
 
5
+ ## 0.11.1 (2021-03-31)
6
+
7
+ ### Changes
8
+
9
+ * [#126](https://github.com/rubocop/rubocop-minitest/issues/126): Mark `Minitest/AssertWithExpectedArgument` as unsafe. ([@koic][])
10
+
11
+ ## 0.11.0 (2021-03-22)
12
+
13
+ ### New features
14
+
15
+ * [#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][])
16
+
17
+ ### Bug fixes
18
+
19
+ * [#122](https://github.com/rubocop/rubocop-minitest/pull/122): Fix `Minitest/TestMethodName` for tests with multiple assertions. ([@ghiculescu][])
20
+
21
+ ### Changes
22
+
23
+ * [#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][])
24
+ * [#125](https://github.com/rubocop/rubocop-minitest/pull/125): Require RuboCop 0.90 or higher. ([@koic][])
25
+
26
+ ## 0.10.3 (2021-01-12)
27
+
28
+ ### Bug fixes
29
+
30
+ * [#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][])
31
+
32
+ ## 0.10.2 (2020-12-27)
33
+
34
+ ### Bug fixes
35
+
36
+ * [#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][])
37
+
38
+ ## 0.10.1 (2020-07-25)
39
+
40
+ ### Bug fixes
41
+
42
+ * [#106](https://github.com/rubocop/rubocop-minitest/issues/106): Fix an error for `Minitest/AssertOutput` when using gvar at top level. ([@koic][])
43
+
5
44
  ## 0.10.0 (2020-07-12)
6
45
 
7
46
  ### New features
8
47
 
9
- * [#92](https://github.com/rubocop-hq/rubocop-minitest/pull/92): Add new `Minitest/LiteralAsActualArgument` cop. ([@fatkodima][], [@tsmmark][])
10
- * [#95](https://github.com/rubocop-hq/rubocop-minitest/pull/95): Add new `Minitest/AssertionInLifecycleHook` cop. ([@fatkodima][])
11
- * [#91](https://github.com/rubocop-hq/rubocop-minitest/pull/91): Add new `Minitest/AssertInDelta` and `Minitest/RefuteInDelta` cops. ([@fatkodima][])
12
- * [#89](https://github.com/rubocop-hq/rubocop-minitest/pull/89): Add new `Minitest/TestMethodName` cop. ([@fatkodima][])
13
- * [#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][])
14
- * [#88](https://github.com/rubocop-hq/rubocop-minitest/pull/88): Add new `Minitest/MultipleAssertions` cop. ([@fatkodima][])
15
- * [#87](https://github.com/rubocop-hq/rubocop-minitest/pull/87): Add new `Minitest/AssertSilent` cop. ([@fatkodima][])
16
- * [#96](https://github.com/rubocop-hq/rubocop-minitest/pull/96): Add new `Minitest/UnspecifiedException` cop. ([@fatkodima][])
17
- * [#98](https://github.com/rubocop-hq/rubocop-minitest/pull/98): Add new `Minitest/AssertOutput` cop. ([@fatkodima][])
18
- * [#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][])
19
- * [#85](https://github.com/rubocop-hq/rubocop-minitest/pull/85): Add autocorrect to `Rails/AssertEmptyLiteral` cop. ([@fatkodima][])
48
+ * [#92](https://github.com/rubocop/rubocop-minitest/pull/92): Add new `Minitest/LiteralAsActualArgument` cop. ([@fatkodima][], [@tsmmark][])
49
+ * [#95](https://github.com/rubocop/rubocop-minitest/pull/95): Add new `Minitest/AssertionInLifecycleHook` cop. ([@fatkodima][])
50
+ * [#91](https://github.com/rubocop/rubocop-minitest/pull/91): Add new `Minitest/AssertInDelta` and `Minitest/RefuteInDelta` cops. ([@fatkodima][])
51
+ * [#89](https://github.com/rubocop/rubocop-minitest/pull/89): Add new `Minitest/TestMethodName` cop. ([@fatkodima][])
52
+ * [#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][])
53
+ * [#88](https://github.com/rubocop/rubocop-minitest/pull/88): Add new `Minitest/MultipleAssertions` cop. ([@fatkodima][])
54
+ * [#87](https://github.com/rubocop/rubocop-minitest/pull/87): Add new `Minitest/AssertSilent` cop. ([@fatkodima][])
55
+ * [#96](https://github.com/rubocop/rubocop-minitest/pull/96): Add new `Minitest/UnspecifiedException` cop. ([@fatkodima][])
56
+ * [#98](https://github.com/rubocop/rubocop-minitest/pull/98): Add new `Minitest/AssertOutput` cop. ([@fatkodima][])
57
+ * [#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][])
58
+ * [#85](https://github.com/rubocop/rubocop-minitest/pull/85): Add autocorrect to `Rails/AssertEmptyLiteral` cop. ([@fatkodima][])
20
59
 
21
60
  ### Changes
22
61
 
23
- * [#104](https://github.com/rubocop-hq/rubocop-minitest/pull/104): Require RuboCop 0.87 or higher. ([@koic][])
62
+ * [#104](https://github.com/rubocop/rubocop-minitest/pull/104): Require RuboCop 0.87 or higher. ([@koic][])
24
63
 
25
64
  ## 0.9.0 (2020-04-13)
26
65
 
27
66
  ### Bug fixes
28
67
 
29
- * [#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][])
68
+ * [#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][])
30
69
 
31
70
  ### Changes
32
71
 
33
- * [#73](https://github.com/rubocop-hq/rubocop-minitest/issues/73): The Minitest department works on file names end with `_test.rb` by default. ([@koic][])
34
- * [#77](https://github.com/rubocop-hq/rubocop-minitest/pull/77): **(BREAKING)** Drop support for Ruby 2.3. ([@koic][])
72
+ * [#73](https://github.com/rubocop/rubocop-minitest/issues/73): The Minitest department works on file names end with `_test.rb` by default. ([@koic][])
73
+ * [#77](https://github.com/rubocop/rubocop-minitest/pull/77): **(BREAKING)** Drop support for Ruby 2.3. ([@koic][])
35
74
 
36
75
  ## 0.8.1 (2020-04-06)
37
76
 
38
77
  ### Bug fixes
39
78
 
40
- * [#72](https://github.com/rubocop-hq/rubocop-minitest/pull/72): Fix some false negatives for `Minitest/GlobalExpectations`. ([@andrykonchin][])
79
+ * [#72](https://github.com/rubocop/rubocop-minitest/pull/72): Fix some false negatives for `Minitest/GlobalExpectations`. ([@andrykonchin][])
41
80
 
42
81
  ## 0.8.0 (2020-03-24)
43
82
 
44
83
  ### New features
45
84
 
46
- * [#66](https://github.com/rubocop-hq/rubocop-minitest/issues/66): Support all expectations of `Minitest::Expectations` for `Minitest/GlobalExpectations` cop. ([@koic][])
85
+ * [#66](https://github.com/rubocop/rubocop-minitest/issues/66): Support all expectations of `Minitest::Expectations` for `Minitest/GlobalExpectations` cop. ([@koic][])
47
86
 
48
87
  ### Bug fixes
49
88
 
50
- * [#60](https://github.com/rubocop-hq/rubocop-minitest/issues/60): Fix `Minitest/GlobalExpectations` autocorrection for chained methods. ([@tejasbubane][])
51
- * [#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][])
52
- * [#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][])
89
+ * [#60](https://github.com/rubocop/rubocop-minitest/issues/60): Fix `Minitest/GlobalExpectations` autocorrection for chained methods. ([@tejasbubane][])
90
+ * [#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][])
91
+ * [#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][])
53
92
 
54
93
  ## 0.7.0 (2020-03-09)
55
94
 
56
95
  ### New features
57
96
 
58
- * [#60](https://github.com/rubocop-hq/rubocop-minitest/issues/60): Add new cop `Minitest/GlobalExpectations` to check for deprecated global expectations. ([@tejasbubane][])
97
+ * [#60](https://github.com/rubocop/rubocop-minitest/issues/60): Add new cop `Minitest/GlobalExpectations` to check for deprecated global expectations. ([@tejasbubane][])
59
98
 
60
99
  ### Bug fixes
61
100
 
62
- * [#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][])
63
- * [#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][])
64
- * [#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][])
65
- * [#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][])
101
+ * [#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][])
102
+ * [#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][])
103
+ * [#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][])
104
+ * [#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][])
66
105
 
67
106
  ## 0.6.2 (2020-02-19)
68
107
 
69
108
  ### Bug fixes
70
109
 
71
- * [#55](https://github.com/rubocop-hq/rubocop-minitest/issues/55): Fix an error for `Minitest/AssertIncludes` when using local variable argument. ([@koic][])
110
+ * [#55](https://github.com/rubocop/rubocop-minitest/issues/55): Fix an error for `Minitest/AssertIncludes` when using local variable argument. ([@koic][])
72
111
 
73
112
  ## 0.6.1 (2020-02-18)
74
113
 
75
114
  ### Bug fixes
76
115
 
77
- * [#52](https://github.com/rubocop-hq/rubocop-minitest/issues/52): Make `Minitest/RefuteFalse` cop aware of `assert(!test)`. ([@koic][])
78
- * [#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][])
116
+ * [#52](https://github.com/rubocop/rubocop-minitest/issues/52): Make `Minitest/RefuteFalse` cop aware of `assert(!test)`. ([@koic][])
117
+ * [#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][])
79
118
 
80
119
  ## 0.6.0 (2020-02-07)
81
120
 
82
121
  ### New features
83
122
 
84
- * [#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][])
123
+ * [#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][])
85
124
 
86
125
  ## 0.5.1 (2019-12-25)
87
126
 
88
127
  ### Bug fixes
89
128
 
90
- * [#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][])
129
+ * [#42](https://github.com/rubocop/rubocop-minitest/issues/42): Fix an incorrect autocorrect for some cops of `Minitest` department when using heredoc message. ([@koic][])
91
130
 
92
131
  ## 0.5.0 (2019-11-24)
93
132
 
94
133
  ### New features
95
134
 
96
- * [#32](https://github.com/rubocop-hq/rubocop-minitest/issues/32): Add new `Minitest/AssertEmptyLiteral` cop. ([@tejasbubane][])
135
+ * [#32](https://github.com/rubocop/rubocop-minitest/issues/32): Add new `Minitest/AssertEmptyLiteral` cop. ([@tejasbubane][])
97
136
 
98
137
  ## 0.4.1 (2019-11-10)
99
138
 
100
139
  ### Bug fixes
101
140
 
102
- * [#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][])
141
+ * [#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][])
103
142
 
104
143
  ## 0.4.0 (2019-11-07)
105
144
 
106
145
  ### New features
107
146
 
108
- * [#29](https://github.com/rubocop-hq/rubocop-minitest/pull/29): Add new `Minitest/RefuteRespondTo` cop. ([@herwinw][])
109
- * [#31](https://github.com/rubocop-hq/rubocop-minitest/pull/31): Add new `Minitest/AssertEqual` cop. ([@herwinw][])
110
- * [#34](https://github.com/rubocop-hq/rubocop-minitest/pull/34): Add new `Minitest/AssertInstanceOf` cop. ([@abhaynikam][])
111
- * [#35](https://github.com/rubocop-hq/rubocop-minitest/pull/35): Add new `Minitest/RefuteInstanceOf` cop. ([@abhaynikam][])
147
+ * [#29](https://github.com/rubocop/rubocop-minitest/pull/29): Add new `Minitest/RefuteRespondTo` cop. ([@herwinw][])
148
+ * [#31](https://github.com/rubocop/rubocop-minitest/pull/31): Add new `Minitest/AssertEqual` cop. ([@herwinw][])
149
+ * [#34](https://github.com/rubocop/rubocop-minitest/pull/34): Add new `Minitest/AssertInstanceOf` cop. ([@abhaynikam][])
150
+ * [#35](https://github.com/rubocop/rubocop-minitest/pull/35): Add new `Minitest/RefuteInstanceOf` cop. ([@abhaynikam][])
112
151
 
113
152
  ### Bug fixes
114
153
 
115
- * [#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][])
154
+ * [#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][])
116
155
 
117
156
  ## 0.3.0 (2019-10-13)
118
157
 
119
158
  ### New features
120
159
 
121
- * [#15](https://github.com/rubocop-hq/rubocop-minitest/pull/15): Add new `Minitest/RefuteIncludes` cop. ([@abhaynikam][])
122
- * [#18](https://github.com/rubocop-hq/rubocop-minitest/pull/18): Add new `Minitest/RefuteFalse` cop. ([@duduribeiro][])
123
- * [#20](https://github.com/rubocop-hq/rubocop-minitest/pull/20): Add new `Minitest/RefuteEmpty` cop. ([@abhaynikam][])
124
- * [#21](https://github.com/rubocop-hq/rubocop-minitest/pull/21): Add new `Minitest/RefuteEqual` cop. ([@duduribeiro][])
125
- * [#27](https://github.com/rubocop-hq/rubocop-minitest/pull/27): Add new `Minitest/AssertRespondTo` cop. ([@duduribeiro][])
160
+ * [#15](https://github.com/rubocop/rubocop-minitest/pull/15): Add new `Minitest/RefuteIncludes` cop. ([@abhaynikam][])
161
+ * [#18](https://github.com/rubocop/rubocop-minitest/pull/18): Add new `Minitest/RefuteFalse` cop. ([@duduribeiro][])
162
+ * [#20](https://github.com/rubocop/rubocop-minitest/pull/20): Add new `Minitest/RefuteEmpty` cop. ([@abhaynikam][])
163
+ * [#21](https://github.com/rubocop/rubocop-minitest/pull/21): Add new `Minitest/RefuteEqual` cop. ([@duduribeiro][])
164
+ * [#27](https://github.com/rubocop/rubocop-minitest/pull/27): Add new `Minitest/AssertRespondTo` cop. ([@duduribeiro][])
126
165
 
127
166
  ### Bug fixes
128
167
 
129
- * [#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][])
168
+ * [#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][])
130
169
 
131
170
  ## 0.2.1 (2019-09-24)
132
171
 
133
172
  ### Bug fixes
134
173
 
135
- * [#13](https://github.com/rubocop-hq/rubocop-minitest/issues/13): Fix the execution target specified in `Include` parameter. ([@koic][])
174
+ * [#13](https://github.com/rubocop/rubocop-minitest/issues/13): Fix the execution target specified in `Include` parameter. ([@koic][])
136
175
 
137
176
  ## 0.2.0 (2019-09-21)
138
177
 
139
178
  ### New features
140
179
 
141
- * [#11](https://github.com/rubocop-hq/rubocop-minitest/pull/11): Add new `Minitest/RefuteNil` cop. ([@tejasbubane][])
142
- * [#8](https://github.com/rubocop-hq/rubocop-minitest/pull/8): Add new `Minitest/AssertTruthy` cop. ([@abhaynikam][])
143
- * [#9](https://github.com/rubocop-hq/rubocop-minitest/pull/9): Add new `Minitest/AssertIncludes` cop. ([@abhaynikam][])
144
- * [#10](https://github.com/rubocop-hq/rubocop-minitest/pull/10): Add new `Minitest/AssertEmpty` cop. ([@abhaynikam][])
180
+ * [#11](https://github.com/rubocop/rubocop-minitest/pull/11): Add new `Minitest/RefuteNil` cop. ([@tejasbubane][])
181
+ * [#8](https://github.com/rubocop/rubocop-minitest/pull/8): Add new `Minitest/AssertTruthy` cop. ([@abhaynikam][])
182
+ * [#9](https://github.com/rubocop/rubocop-minitest/pull/9): Add new `Minitest/AssertIncludes` cop. ([@abhaynikam][])
183
+ * [#10](https://github.com/rubocop/rubocop-minitest/pull/10): Add new `Minitest/AssertEmpty` cop. ([@abhaynikam][])
145
184
 
146
185
  ## 0.1.0 (2019-09-01)
147
186
 
148
187
  ### New features
149
188
 
150
189
  * Create RuboCop Minitest gem. ([@koic][])
151
- * [#6](https://github.com/rubocop-hq/rubocop-minitest/pull/6): Add new `Minitest/AssertNil` cop. ([@duduribeiro][])
190
+ * [#6](https://github.com/rubocop/rubocop-minitest/pull/6): Add new `Minitest/AssertNil` cop. ([@duduribeiro][])
152
191
 
153
192
  [@koic]: https://github.com/koic
154
193
  [@duduribeiro]: https://github.com/duduribeiro
@@ -159,3 +198,5 @@
159
198
  [@andrykonchin]: https://github.com/andrykonchin
160
199
  [@fatkodima]: https://github.com/fatkodima
161
200
  [@tsmmark]: https://github.com/tsmmark
201
+ [@cstyles]: https://github.com/cstyles
202
+ [@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.6.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
@@ -77,6 +77,22 @@ Minitest/AssertNil:
77
77
 
78
78
  You can read a lot more about RuboCop Minitest in its [official docs](https://docs.rubocop.org/rubocop-minitest/).
79
79
 
80
+ ## Readme Badge
81
+
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
+
84
+ [![Minitest Style Guide](https://img.shields.io/badge/code_style-rubocop-brightgreen.svg)](https://github.com/rubocop/rubocop-minitest)
85
+
86
+ [![Minitest Style Guide](https://img.shields.io/badge/code_style-community-brightgreen.svg)](https://minitest.rubystyle.guide)
87
+
88
+ Here are the Markdown snippets for the two badges:
89
+
90
+ ``` markdown
91
+ [![Minitest Style Guide](https://img.shields.io/badge/code_style-rubocop-brightgreen.svg)](https://github.com/rubocop/rubocop-minitest)
92
+
93
+ [![Minitest Style Guide](https://img.shields.io/badge/code_style-community-brightgreen.svg)](https://minitest.rubystyle.guide)
94
+ ```
95
+
80
96
  ## Contributing
81
97
 
82
98
  Checkout the [contribution guidelines](CONTRIBUTING.md).
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'
@@ -156,7 +162,7 @@ Minitest/RefuteInstanceOf:
156
162
 
157
163
  Minitest/RefuteKindOf:
158
164
  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'
165
+ StyleGuide: 'https://github.com/rubocop/minitest-style-guide#refute-kind-of'
160
166
  Enabled: 'pending'
161
167
  VersionAdded: '0.10'
162
168