rubocop-minitest 0.17.0 → 0.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +7 -4
  3. data/.github/PULL_REQUEST_TEMPLATE.md +2 -3
  4. data/.github/workflows/linting.yml +15 -0
  5. data/.rubocop.yml +7 -7
  6. data/.yamllint.yml +9 -0
  7. data/CHANGELOG.md +22 -0
  8. data/Gemfile +3 -0
  9. data/LICENSE.txt +1 -1
  10. data/Rakefile +1 -1
  11. data/config/default.yml +12 -0
  12. data/docs/antora.yml +2 -2
  13. data/docs/modules/ROOT/pages/cops.adoc +2 -0
  14. data/docs/modules/ROOT/pages/cops_minitest.adoc +70 -2
  15. data/docs/modules/ROOT/pages/installation.adoc +1 -1
  16. data/lib/rubocop/cop/minitest/assert_empty_literal.rb +1 -2
  17. data/lib/rubocop/cop/minitest/assert_nil.rb +5 -2
  18. data/lib/rubocop/cop/minitest/assert_path_exists.rb +2 -2
  19. data/lib/rubocop/cop/minitest/assert_predicate.rb +34 -0
  20. data/lib/rubocop/cop/minitest/assert_silent.rb +1 -1
  21. data/lib/rubocop/cop/minitest/assert_truthy.rb +1 -2
  22. data/lib/rubocop/cop/minitest/assertion_in_lifecycle_hook.rb +1 -1
  23. data/lib/rubocop/cop/minitest/multiple_assertions.rb +1 -1
  24. data/lib/rubocop/cop/minitest/no_assertions.rb +1 -1
  25. data/lib/rubocop/cop/minitest/refute_equal.rb +9 -11
  26. data/lib/rubocop/cop/minitest/refute_false.rb +2 -2
  27. data/lib/rubocop/cop/minitest/refute_nil.rb +5 -2
  28. data/lib/rubocop/cop/minitest/refute_path_exists.rb +2 -2
  29. data/lib/rubocop/cop/minitest/refute_predicate.rb +34 -0
  30. data/lib/rubocop/cop/minitest/unreachable_assertion.rb +2 -4
  31. data/lib/rubocop/cop/minitest_cops.rb +3 -0
  32. data/lib/rubocop/cop/mixin/in_delta_mixin.rb +2 -2
  33. data/lib/rubocop/cop/mixin/minitest_cop_rule.rb +2 -6
  34. data/lib/rubocop/cop/mixin/minitest_exploration_helpers.rb +9 -21
  35. data/lib/rubocop/cop/mixin/nil_assertion_handleable.rb +5 -10
  36. data/lib/rubocop/cop/mixin/predicate_assertion_handleable.rb +61 -0
  37. data/lib/rubocop/minitest/assert_offense.rb +3 -3
  38. data/lib/rubocop/minitest/version.rb +1 -1
  39. data/mkdocs.yml +7 -7
  40. data/relnotes/v0.17.1.md +5 -0
  41. data/relnotes/v0.17.2.md +5 -0
  42. data/relnotes/v0.18.0.md +9 -0
  43. data/tasks/cops_documentation.rake +5 -5
  44. data/tasks/cut_release.rake +1 -1
  45. metadata +12 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f04d27399103835be508a28975344afe09018c9f480217824f65c0c43be34b3d
4
- data.tar.gz: 3021b9fa8b826d056b69d2c91b6d447dc66a3acecc82bf439a2931e6f25ea9f6
3
+ metadata.gz: add241b07281db4494e25119722057177e5eb15056360b0907d4b58819b6f371
4
+ data.tar.gz: 0dbe3916ea796caa3c59e04df1b13ade8a11c25b7613187308b3ea90348380fa
5
5
  SHA512:
6
- metadata.gz: 61ae0ab74e4a736221044989b3ef08e5c743b6cd43024c6ed236e276a4fefb0ec6c3fd23232f401ef205d0db5e8575c8cb1b85b31186a8e26c7be031e65f9772
7
- data.tar.gz: a574a9d994741b69bf4280b91ef7321498aeeaec391cdfee7784230baf55a0d45bf4013a8395418b96b442a39fb13b5a33fa23b8bb03d2cce92bb77c040317c9
6
+ metadata.gz: 4ab3dd3b82e55154731f600b942f2ef3dd48e85bf55d8d5d09c94bcb5227e409ea201c45be221cfde00cdb434d4877508bfad26cc7d3d3427c531c0babf146c1
7
+ data.tar.gz: 261d27488e8ee453f9307bb4367a7072dddb544c0dd73c5ac4e70e033875be7916519cf346ede3c5956023d81e5cf0f22b6ab284c85650a8987b0fa95c77f18d
data/.circleci/config.yml CHANGED
@@ -37,16 +37,19 @@ workflows:
37
37
  - documentation-checks
38
38
  - rake_default:
39
39
  name: Ruby 2.5
40
- image: circleci/ruby:2.5
40
+ image: cimg/ruby:2.5
41
41
  - rake_default:
42
42
  name: Ruby 2.6
43
- image: circleci/ruby:2.6
43
+ image: cimg/ruby:2.6
44
44
  - rake_default:
45
45
  name: Ruby 2.7
46
- image: circleci/ruby:2.7
46
+ image: cimg/ruby:2.7
47
47
  - rake_default:
48
48
  name: Ruby 3.0
49
- image: circleci/ruby:3.0
49
+ image: cimg/ruby:3.0
50
+ - rake_default:
51
+ name: Ruby 3.1
52
+ image: cimg/ruby:3.1
50
53
  - rake_default:
51
54
  name: Ruby HEAD
52
55
  image: rubocophq/circleci-ruby-snapshot:latest # Nightly snapshot build
@@ -5,14 +5,13 @@ The more detailed you are, the better.**
5
5
 
6
6
  Before submitting the PR make sure the following are checked:
7
7
 
8
+ * [ ] The PR relates to *only* one subject with a clear title and description in grammatically correct, complete sentences.
8
9
  * [ ] Wrote [good commit messages][1].
9
10
  * [ ] Commit message starts with `[Fix #issue-number]` (if the related issue exists).
10
11
  * [ ] Feature branch is up-to-date with `master` (if not - rebase it).
11
12
  * [ ] Squashed related commits together.
12
13
  * [ ] Added tests.
14
+ * [ ] Ran `bundle exec rake default`. It executes all tests and runs RuboCop on its own code.
13
15
  * [ ] Added an entry (file) to the [changelog folder](https://github.com/rubocop/rubocop-minitest/blob/master/changelog/) named `{change_type}_{change_description}.md` if the new code introduces user-observable changes. See [changelog entry format](https://github.com/rubocop/rubocop/blob/master/CONTRIBUTING.md#changelog-entry-format) for details.
14
- * [ ] The PR relates to *only* one subject with a clear title
15
- and description in grammatically correct, complete sentences.
16
- * [ ] Run `bundle exec rake default`. It executes all tests and RuboCop for itself, and generates the documentation.
17
16
 
18
17
  [1]: https://chris.beams.io/posts/git-commit/
@@ -0,0 +1,15 @@
1
+ name: Linting
2
+ on:
3
+ - pull_request
4
+ jobs:
5
+ yamllint:
6
+ name: Yamllint
7
+ runs-on: ubuntu-latest
8
+ steps:
9
+ - uses: actions/checkout@v2
10
+ - name: Yamllint
11
+ uses: karancode/yamllint-github-action@master
12
+ with:
13
+ yamllint_comment: true
14
+ env:
15
+ GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
data/.rubocop.yml CHANGED
@@ -55,13 +55,13 @@ Layout/ClassStructure:
55
55
  - prepend
56
56
  - extend
57
57
  ExpectedOrder:
58
- - module_inclusion
59
- - constants
60
- - public_class_methods
61
- - initializer
62
- - instance_methods
63
- - protected_methods
64
- - private_methods
58
+ - module_inclusion
59
+ - constants
60
+ - public_class_methods
61
+ - initializer
62
+ - instance_methods
63
+ - protected_methods
64
+ - private_methods
65
65
 
66
66
  # Trailing white space is meaningful in code examples
67
67
  Layout/TrailingWhitespace:
data/.yamllint.yml ADDED
@@ -0,0 +1,9 @@
1
+ extends: default
2
+
3
+ rules:
4
+ comments:
5
+ min-spaces-from-content: 1
6
+ document-start: disable
7
+ line-length: disable
8
+ truthy:
9
+ check-keys: false
data/CHANGELOG.md CHANGED
@@ -2,6 +2,28 @@
2
2
 
3
3
  ## master (unreleased)
4
4
 
5
+ ## 0.18.0 (2022-03-13)
6
+
7
+ ### New features
8
+
9
+ * [#161](https://github.com/rubocop/rubocop-minitest/pull/161): Add new `Minitest/AssertPredicate` and `Minitest/RefutePredicate` cops. ([@koic][])
10
+
11
+ ### Changes
12
+
13
+ * [#162](https://github.com/rubocop/rubocop-minitest/pull/162): Make `Minitest/AssertNil` (`Minitest/RefuteNil`) aware of `assert_predicate(obj, :nil?)` (`refute_predicate(obj, :nil?)`). ([@koic][])
14
+
15
+ ## 0.17.2 (2022-02-12)
16
+
17
+ ### Bug fixes
18
+
19
+ * [#159](https://github.com/rubocop/rubocop-minitest/issues/159): Fix a false positive for `Minitest/UnreachableAssertion` when using only one assertion method in `assert_raises` block. ([@koic][])
20
+
21
+ ## 0.17.1 (2022-01-30)
22
+
23
+ ### Changes
24
+
25
+ * [#158](https://github.com/rubocop/rubocop-minitest/pull/158): Make `Minitest/UnreachableAssertion` aware of `assert` and `refute` prefix methods. ([@koic][])
26
+
5
27
  ## 0.17.0 (2021-11-23)
6
28
 
7
29
  ### New features
data/Gemfile CHANGED
@@ -11,3 +11,6 @@ gem 'rake'
11
11
  gem 'rubocop', github: 'rubocop/rubocop'
12
12
  gem 'rubocop-performance', '~> 1.12.0'
13
13
  gem 'yard', '~> 0.9'
14
+
15
+ local_gemfile = File.expand_path('Gemfile.local', __dir__)
16
+ eval_gemfile local_gemfile if File.exist?(local_gemfile)
data/LICENSE.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2019-2021 Bozhidar Batsov, Jonas Arvidsson, Koichi ITO
3
+ Copyright (c) 2019-2022 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/Rakefile CHANGED
@@ -48,7 +48,7 @@ task :new_cop, [:cop] do |_task, args|
48
48
  generator.write_source
49
49
  generator.write_test
50
50
  generator.inject_require(root_file_path: 'lib/rubocop/cop/minitest_cops.rb')
51
- generator.inject_config(config_file_path: 'config/default.yml', version_added: bump_minor_version)
51
+ generator.inject_config(config_file_path: 'config/default.yml')
52
52
 
53
53
  puts generator.todo
54
54
  end
data/config/default.yml CHANGED
@@ -81,6 +81,12 @@ Minitest/AssertRespondTo:
81
81
  Enabled: true
82
82
  VersionAdded: '0.3'
83
83
 
84
+ Minitest/AssertPredicate:
85
+ Description: 'This cop enforces the test to use `assert_predicate` instead of using `assert(obj.a_predicate_method?)`.'
86
+ StyleGuide: 'https://minitest.rubystyle.guide/#assert-predicate'
87
+ Enabled: pending
88
+ VersionAdded: '0.18'
89
+
84
90
  Minitest/AssertSilent:
85
91
  Description: "This cop enforces the test to use `assert_silent { ... }` instead of using `assert_output('', '') { ... }`."
86
92
  StyleGuide: 'https://github.com/rubocop/minitest-style-guide#assert-silent'
@@ -194,6 +200,12 @@ Minitest/RefutePathExists:
194
200
  Enabled: 'pending'
195
201
  VersionAdded: '0.10'
196
202
 
203
+ Minitest/RefutePredicate:
204
+ Description: 'This cop enforces the test to use `refute_predicate` instead of using `refute(obj.a_predicate_method?)`.'
205
+ StyleGuide: 'https://minitest.rubystyle.guide/#refute-predicate'
206
+ Enabled: pending
207
+ VersionAdded: '0.18'
208
+
197
209
  Minitest/RefuteRespondTo:
198
210
  Description: 'This cop enforces the test to use `refute_respond_to(object, :do_something)` over `refute(object.respond_to?(:do_something))`.'
199
211
  StyleGuide: 'https://minitest.rubystyle.guide#refute-respond-to'
data/docs/antora.yml CHANGED
@@ -2,6 +2,6 @@ name: rubocop-minitest
2
2
  title: RuboCop Minitest
3
3
  # We always provide version without patch here (e.g. 1.1),
4
4
  # as patch versions should not appear in the docs.
5
- version: '0.17'
5
+ version: '0.18'
6
6
  nav:
7
- - modules/ROOT/nav.adoc
7
+ - modules/ROOT/nav.adoc
@@ -24,6 +24,7 @@ based on the https://minitest.rubystyle.guide/[Minitest Style Guide].
24
24
  * xref:cops_minitest.adoc#minitestassertnil[Minitest/AssertNil]
25
25
  * xref:cops_minitest.adoc#minitestassertoutput[Minitest/AssertOutput]
26
26
  * xref:cops_minitest.adoc#minitestassertpathexists[Minitest/AssertPathExists]
27
+ * xref:cops_minitest.adoc#minitestassertpredicate[Minitest/AssertPredicate]
27
28
  * xref:cops_minitest.adoc#minitestassertrespondto[Minitest/AssertRespondTo]
28
29
  * xref:cops_minitest.adoc#minitestassertsilent[Minitest/AssertSilent]
29
30
  * xref:cops_minitest.adoc#minitestasserttruthy[Minitest/AssertTruthy]
@@ -43,6 +44,7 @@ based on the https://minitest.rubystyle.guide/[Minitest Style Guide].
43
44
  * xref:cops_minitest.adoc#minitestrefutematch[Minitest/RefuteMatch]
44
45
  * xref:cops_minitest.adoc#minitestrefutenil[Minitest/RefuteNil]
45
46
  * xref:cops_minitest.adoc#minitestrefutepathexists[Minitest/RefutePathExists]
47
+ * xref:cops_minitest.adoc#minitestrefutepredicate[Minitest/RefutePredicate]
46
48
  * xref:cops_minitest.adoc#minitestrefuterespondto[Minitest/RefuteRespondTo]
47
49
  * xref:cops_minitest.adoc#minitesttestmethodname[Minitest/TestMethodName]
48
50
  * xref:cops_minitest.adoc#minitestunreachableassertion[Minitest/UnreachableAssertion]
@@ -262,7 +262,7 @@ assert_match(matcher, string, 'message')
262
262
  |===
263
263
 
264
264
  This cop enforces the test to use `assert_nil` instead of using
265
- `assert_equal(nil, something)` or `assert(something.nil?)`.
265
+ `assert_equal(nil, something)`, `assert(something.nil?)`, or `assert_predicate(something, :nil?)`.
266
266
 
267
267
  === Examples
268
268
 
@@ -273,6 +273,8 @@ assert_equal(nil, actual)
273
273
  assert_equal(nil, actual, 'message')
274
274
  assert(object.nil?)
275
275
  assert(object.nil?, 'message')
276
+ assert_predicate(object, :nil?)
277
+ assert_predicate(object, :nil?, 'message')
276
278
 
277
279
  # good
278
280
  assert_nil(actual)
@@ -347,6 +349,38 @@ assert_path_exists(path, 'message')
347
349
 
348
350
  * https://minitest.rubystyle.guide/#assert-path-exists
349
351
 
352
+ == Minitest/AssertPredicate
353
+
354
+ |===
355
+ | Enabled by default | Safe | Supports autocorrection | Version Added | Version Changed
356
+
357
+ | Pending
358
+ | Yes
359
+ | Yes
360
+ | 0.18
361
+ | -
362
+ |===
363
+
364
+ This cop enforces the test to use `assert_predicate`
365
+ instead of using `assert(obj.a_predicate_method?)`.
366
+
367
+ === Examples
368
+
369
+ [source,ruby]
370
+ ----
371
+ # bad
372
+ assert(obj.one?)
373
+ assert(obj.one?, 'message')
374
+
375
+ # good
376
+ assert_predicate(obj, :one?)
377
+ assert_predicate(obj, :one?, 'message')
378
+ ----
379
+
380
+ === References
381
+
382
+ * https://minitest.rubystyle.guide/#assert-predicate
383
+
350
384
  == Minitest/AssertRespondTo
351
385
 
352
386
  |===
@@ -1025,7 +1059,7 @@ refute_match(matcher, string, 'message')
1025
1059
  |===
1026
1060
 
1027
1061
  This cop enforces the test to use `refute_nil` instead of using
1028
- `refute_equal(nil, something)` or `refute(something.nil?)`.
1062
+ `refute_equal(nil, something)`, `refute(something.nil?)`, or `refute_predicate(something, :nil?)`.
1029
1063
 
1030
1064
  === Examples
1031
1065
 
@@ -1036,6 +1070,8 @@ refute_equal(nil, actual)
1036
1070
  refute_equal(nil, actual, 'message')
1037
1071
  refute(actual.nil?)
1038
1072
  refute(actual.nil?, 'message')
1073
+ refute_predicate(object, :nil?)
1074
+ refute_predicate(object, :nil?, 'message')
1039
1075
 
1040
1076
  # good
1041
1077
  refute_nil(actual)
@@ -1078,6 +1114,38 @@ refute_path_exists(path, 'message')
1078
1114
 
1079
1115
  * https://minitest.rubystyle.guide/#refute-path-exists
1080
1116
 
1117
+ == Minitest/RefutePredicate
1118
+
1119
+ |===
1120
+ | Enabled by default | Safe | Supports autocorrection | Version Added | Version Changed
1121
+
1122
+ | Pending
1123
+ | Yes
1124
+ | Yes
1125
+ | 0.18
1126
+ | -
1127
+ |===
1128
+
1129
+ This cop enforces the test to use `refute_predicate`
1130
+ instead of using `refute(obj.a_predicate_method?)`.
1131
+
1132
+ === Examples
1133
+
1134
+ [source,ruby]
1135
+ ----
1136
+ # bad
1137
+ refute(obj.one?)
1138
+ refute(obj.one?, 'message')
1139
+
1140
+ # good
1141
+ refute_predicate(obj, :one?)
1142
+ refute_predicate(obj, :one?, 'message')
1143
+ ----
1144
+
1145
+ === References
1146
+
1147
+ * https://minitest.rubystyle.guide/#refute-predicate
1148
+
1081
1149
  == Minitest/RefuteRespondTo
1082
1150
 
1083
1151
  |===
@@ -11,5 +11,5 @@ or if you use bundler put this in your `Gemfile`
11
11
 
12
12
  [source,ruby]
13
13
  ----
14
- gem 'rubocop-minitest'
14
+ gem 'rubocop-minitest', require: false
15
15
  ----
@@ -18,8 +18,7 @@ module RuboCop
18
18
  include ArgumentRangeHelper
19
19
  extend AutoCorrector
20
20
 
21
- MSG = 'Prefer using `assert_empty(%<arguments>s)` over ' \
22
- '`assert_equal(%<literal>s, %<arguments>s)`.'
21
+ MSG = 'Prefer using `assert_empty(%<arguments>s)`.'
23
22
  RESTRICT_ON_SEND = %i[assert_equal].freeze
24
23
 
25
24
  def_node_matcher :assert_equal_with_empty_literal, <<~PATTERN
@@ -4,7 +4,7 @@ module RuboCop
4
4
  module Cop
5
5
  module Minitest
6
6
  # This cop enforces the test to use `assert_nil` instead of using
7
- # `assert_equal(nil, something)` or `assert(something.nil?)`.
7
+ # `assert_equal(nil, something)`, `assert(something.nil?)`, or `assert_predicate(something, :nil?)`.
8
8
  #
9
9
  # @example
10
10
  # # bad
@@ -12,6 +12,8 @@ module RuboCop
12
12
  # assert_equal(nil, actual, 'message')
13
13
  # assert(object.nil?)
14
14
  # assert(object.nil?, 'message')
15
+ # assert_predicate(object, :nil?)
16
+ # assert_predicate(object, :nil?, 'message')
15
17
  #
16
18
  # # good
17
19
  # assert_nil(actual)
@@ -23,12 +25,13 @@ module RuboCop
23
25
  extend AutoCorrector
24
26
 
25
27
  ASSERTION_TYPE = 'assert'
26
- RESTRICT_ON_SEND = %i[assert_equal assert].freeze
28
+ RESTRICT_ON_SEND = %i[assert assert_equal assert_predicate].freeze
27
29
 
28
30
  def_node_matcher :nil_assertion, <<~PATTERN
29
31
  {
30
32
  (send nil? :assert_equal nil $_ $...)
31
33
  (send nil? :assert (send $_ :nil?) $...)
34
+ (send nil? :assert_predicate $_ (sym :nil?) $...)
32
35
  }
33
36
  PATTERN
34
37
 
@@ -18,7 +18,7 @@ module RuboCop
18
18
  class AssertPathExists < Base
19
19
  extend AutoCorrector
20
20
 
21
- MSG = 'Prefer using `%<good_method>s` over `%<bad_method>s`.'
21
+ MSG = 'Prefer using `%<good_method>s`.'
22
22
  RESTRICT_ON_SEND = %i[assert].freeze
23
23
 
24
24
  def_node_matcher :assert_file_exists, <<~PATTERN
@@ -32,7 +32,7 @@ module RuboCop
32
32
  assert_file_exists(node) do |path, failure_message|
33
33
  failure_message = failure_message.first
34
34
  good_method = build_good_method(path, failure_message)
35
- message = format(MSG, good_method: good_method, bad_method: node.source)
35
+ message = format(MSG, good_method: good_method)
36
36
 
37
37
  add_offense(node, message: message) do |corrector|
38
38
  corrector.replace(node, good_method)
@@ -0,0 +1,34 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RuboCop
4
+ module Cop
5
+ module Minitest
6
+ # This cop enforces the test to use `assert_predicate`
7
+ # instead of using `assert(obj.a_predicate_method?)`.
8
+ #
9
+ # @example
10
+ # # bad
11
+ # assert(obj.one?)
12
+ # assert(obj.one?, 'message')
13
+ #
14
+ # # good
15
+ # assert_predicate(obj, :one?)
16
+ # assert_predicate(obj, :one?, 'message')
17
+ #
18
+ class AssertPredicate < Base
19
+ include ArgumentRangeHelper
20
+ include PredicateAssertionHandleable
21
+ extend AutoCorrector
22
+
23
+ MSG = 'Prefer using `assert_predicate(%<new_arguments>s)`.'
24
+ RESTRICT_ON_SEND = %i[assert].freeze
25
+
26
+ private
27
+
28
+ def assertion_type
29
+ 'assert'
30
+ end
31
+ end
32
+ end
33
+ end
34
+ end
@@ -16,7 +16,7 @@ module RuboCop
16
16
  class AssertSilent < Base
17
17
  extend AutoCorrector
18
18
 
19
- MSG = 'Prefer using `assert_silent` over `assert_output("", "")`.'
19
+ MSG = 'Prefer using `assert_silent`.'
20
20
 
21
21
  def_node_matcher :assert_silent_candidate?, <<~PATTERN
22
22
  (block
@@ -19,8 +19,7 @@ module RuboCop
19
19
  include ArgumentRangeHelper
20
20
  extend AutoCorrector
21
21
 
22
- MSG = 'Prefer using `assert(%<arguments>s)` over ' \
23
- '`assert_equal(true, %<arguments>s)`.'
22
+ MSG = 'Prefer using `assert(%<arguments>s)`.'
24
23
  RESTRICT_ON_SEND = %i[assert_equal].freeze
25
24
 
26
25
  def_node_matcher :assert_equal_with_truthy, <<~PATTERN
@@ -30,7 +30,7 @@ module RuboCop
30
30
 
31
31
  lifecycle_hooks(class_node).each do |hook_node|
32
32
  hook_node.each_descendant(:send) do |node|
33
- if assertion?(node)
33
+ if assertion_method?(node)
34
34
  message = format(MSG, assertion: node.method_name, hook: hook_node.method_name)
35
35
  add_offense(node, message: message)
36
36
  end
@@ -50,7 +50,7 @@ module RuboCop
50
50
  private
51
51
 
52
52
  def assertions_count(node)
53
- base = assertion?(node) ? 1 : 0
53
+ base = assertion_method?(node) ? 1 : 0
54
54
  base + node.each_child_node.sum { |c| assertions_count(c) }
55
55
  end
56
56
 
@@ -39,7 +39,7 @@ module RuboCop
39
39
  private
40
40
 
41
41
  def assertions_count(node)
42
- base = assertion?(node) ? 1 : 0
42
+ base = assertion_method?(node) ? 1 : 0
43
43
  base + node.each_child_node.sum { |c| assertions_count(c) }
44
44
  end
45
45
  end
@@ -18,20 +18,19 @@ module RuboCop
18
18
  include ArgumentRangeHelper
19
19
  extend AutoCorrector
20
20
 
21
- MSG = 'Prefer using `refute_equal(%<preferred>s)` over ' \
22
- '`assert(%<over>s)`.'
21
+ MSG = 'Prefer using `refute_equal(%<preferred>s)`.'
23
22
  RESTRICT_ON_SEND = %i[assert].freeze
24
23
 
25
24
  def_node_matcher :assert_not_equal, <<~PATTERN
26
- (send nil? :assert ${(send $_ :!= $_) (send (send $_ :! ) :== $_) } $... )
25
+ (send nil? :assert {(send $_ :!= $_) (send (send $_ :! ) :== $_) } $... )
27
26
  PATTERN
28
27
 
29
28
  def on_send(node)
30
- preferred, over = process_not_equal(node)
31
- return unless preferred && over
29
+ preferred = process_not_equal(node)
30
+ return unless preferred
32
31
 
33
- assert_not_equal(node) do |_, expected, actual|
34
- message = format(MSG, preferred: preferred, over: over)
32
+ assert_not_equal(node) do |expected, actual|
33
+ message = format(MSG, preferred: preferred)
35
34
 
36
35
  add_offense(node, message: message) do |corrector|
37
36
  corrector.replace(node.loc.selector, 'refute_equal')
@@ -54,11 +53,10 @@ module RuboCop
54
53
  end
55
54
 
56
55
  def process_not_equal(node)
57
- assert_not_equal(node) do |over, first_arg, second_arg, rest_args|
56
+ assert_not_equal(node) do |first_arg, second_arg, rest_args|
58
57
  custom_message = rest_args.first
59
- preferred = preferred_usage(first_arg, second_arg, custom_message)
60
- over = original_usage(over.source, custom_message&.source)
61
- return [preferred, over]
58
+
59
+ preferred_usage(first_arg, second_arg, custom_message)
62
60
  end
63
61
  end
64
62
  end
@@ -22,8 +22,8 @@ module RuboCop
22
22
  include ArgumentRangeHelper
23
23
  extend AutoCorrector
24
24
 
25
- MSG_FOR_ASSERT_EQUAL = 'Prefer using `refute(%<arguments>s)` over `assert_equal(false, %<arguments>s)`.'
26
- MSG_FOR_ASSERT = 'Prefer using `refute(%<arguments>s)` over `assert(!%<arguments>s)`.'
25
+ MSG_FOR_ASSERT_EQUAL = 'Prefer using `refute(%<arguments>s)`.'
26
+ MSG_FOR_ASSERT = 'Prefer using `refute(%<arguments>s)`.'
27
27
  RESTRICT_ON_SEND = %i[assert_equal assert].freeze
28
28
 
29
29
  def_node_matcher :assert_equal_with_false, <<~PATTERN
@@ -4,7 +4,7 @@ module RuboCop
4
4
  module Cop
5
5
  module Minitest
6
6
  # This cop enforces the test to use `refute_nil` instead of using
7
- # `refute_equal(nil, something)` or `refute(something.nil?)`.
7
+ # `refute_equal(nil, something)`, `refute(something.nil?)`, or `refute_predicate(something, :nil?)`.
8
8
  #
9
9
  # @example
10
10
  # # bad
@@ -12,6 +12,8 @@ module RuboCop
12
12
  # refute_equal(nil, actual, 'message')
13
13
  # refute(actual.nil?)
14
14
  # refute(actual.nil?, 'message')
15
+ # refute_predicate(object, :nil?)
16
+ # refute_predicate(object, :nil?, 'message')
15
17
  #
16
18
  # # good
17
19
  # refute_nil(actual)
@@ -23,12 +25,13 @@ module RuboCop
23
25
  extend AutoCorrector
24
26
 
25
27
  ASSERTION_TYPE = 'refute'
26
- RESTRICT_ON_SEND = %i[refute_equal refute].freeze
28
+ RESTRICT_ON_SEND = %i[refute refute_equal refute_predicate].freeze
27
29
 
28
30
  def_node_matcher :nil_refutation, <<~PATTERN
29
31
  {
30
32
  (send nil? :refute_equal nil $_ $...)
31
33
  (send nil? :refute (send $_ :nil?) $...)
34
+ (send nil? :refute_predicate $_ (sym :nil?) $...)
32
35
  }
33
36
  PATTERN
34
37
 
@@ -18,7 +18,7 @@ module RuboCop
18
18
  class RefutePathExists < Base
19
19
  extend AutoCorrector
20
20
 
21
- MSG = 'Prefer using `%<good_method>s` over `%<bad_method>s`.'
21
+ MSG = 'Prefer using `%<good_method>s`.'
22
22
  RESTRICT_ON_SEND = %i[refute].freeze
23
23
 
24
24
  def_node_matcher :refute_file_exists, <<~PATTERN
@@ -32,7 +32,7 @@ module RuboCop
32
32
  refute_file_exists(node) do |path, failure_message|
33
33
  failure_message = failure_message.first
34
34
  good_method = build_good_method(path, failure_message)
35
- message = format(MSG, good_method: good_method, bad_method: node.source)
35
+ message = format(MSG, good_method: good_method)
36
36
 
37
37
  add_offense(node, message: message) do |corrector|
38
38
  corrector.replace(node, good_method)
@@ -0,0 +1,34 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RuboCop
4
+ module Cop
5
+ module Minitest
6
+ # This cop enforces the test to use `refute_predicate`
7
+ # instead of using `refute(obj.a_predicate_method?)`.
8
+ #
9
+ # @example
10
+ # # bad
11
+ # refute(obj.one?)
12
+ # refute(obj.one?, 'message')
13
+ #
14
+ # # good
15
+ # refute_predicate(obj, :one?)
16
+ # refute_predicate(obj, :one?, 'message')
17
+ #
18
+ class RefutePredicate < Base
19
+ include ArgumentRangeHelper
20
+ include PredicateAssertionHandleable
21
+ extend AutoCorrector
22
+
23
+ MSG = 'Prefer using `refute_predicate(%<new_arguments>s)`.'
24
+ RESTRICT_ON_SEND = %i[refute].freeze
25
+
26
+ private
27
+
28
+ def assertion_type
29
+ 'refute'
30
+ end
31
+ end
32
+ end
33
+ end
34
+ end
@@ -30,11 +30,9 @@ module RuboCop
30
30
 
31
31
  last_node = body.begin_type? ? body.children.last : body
32
32
  return unless last_node.send_type?
33
+ return if !assertion_method?(last_node) || !body.begin_type?
33
34
 
34
- method_name = last_node.method_name
35
- return unless assertion_method?(method_name)
36
-
37
- add_offense(last_node, message: format(MSG, assertion_method: method_name))
35
+ add_offense(last_node, message: format(MSG, assertion_method: last_node.method_name))
38
36
  end
39
37
  end
40
38
  end
@@ -5,10 +5,12 @@ require_relative 'mixin/in_delta_mixin'
5
5
  require_relative 'mixin/minitest_cop_rule'
6
6
  require_relative 'mixin/minitest_exploration_helpers'
7
7
  require_relative 'mixin/nil_assertion_handleable'
8
+ require_relative 'mixin/predicate_assertion_handleable'
8
9
  require_relative 'minitest/assert_empty'
9
10
  require_relative 'minitest/assert_empty_literal'
10
11
  require_relative 'minitest/assert_equal'
11
12
  require_relative 'minitest/assert_in_delta'
13
+ require_relative 'minitest/assert_predicate'
12
14
  require_relative 'minitest/assert_with_expected_argument'
13
15
  require_relative 'minitest/assertion_in_lifecycle_hook'
14
16
  require_relative 'minitest/assert_kind_of'
@@ -35,6 +37,7 @@ require_relative 'minitest/refute_includes'
35
37
  require_relative 'minitest/refute_match'
36
38
  require_relative 'minitest/refute_instance_of'
37
39
  require_relative 'minitest/refute_path_exists'
40
+ require_relative 'minitest/refute_predicate'
38
41
  require_relative 'minitest/refute_respond_to'
39
42
  require_relative 'minitest/test_method_name'
40
43
  require_relative 'minitest/unreachable_assertion'
@@ -4,7 +4,7 @@ module RuboCop
4
4
  module Cop
5
5
  # Common functionality for `AssertInDelta` and `RefuteInDelta` cops.
6
6
  module InDeltaMixin
7
- MSG = 'Prefer using `%<good_method>s` over `%<bad_method>s`.'
7
+ MSG = 'Prefer using `%<good_method>s`.'
8
8
 
9
9
  def on_send(node)
10
10
  equal_floats_call(node) do |expected, actual, message|
@@ -12,7 +12,7 @@ module RuboCop
12
12
  good_method = build_good_method(expected, actual, message)
13
13
 
14
14
  if expected.float_type? || actual.float_type?
15
- message = format(MSG, good_method: good_method, bad_method: node.source)
15
+ message = format(MSG, good_method: good_method)
16
16
 
17
17
  add_offense(node, message: message) do |corrector|
18
18
  corrector.replace(node, good_method)
@@ -28,8 +28,7 @@ module RuboCop
28
28
  include ArgumentRangeHelper
29
29
  extend AutoCorrector
30
30
 
31
- MSG = 'Prefer using `#{preferred_method}(%<new_arguments>s)` over ' \
32
- '`#{assertion_method}(%<original_arguments>s)`.'
31
+ MSG = 'Prefer using `#{preferred_method}(%<new_arguments>s)`.'
33
32
  RESTRICT_ON_SEND = %i[#{assertion_method}].freeze
34
33
 
35
34
  def on_send(node)
@@ -70,12 +69,9 @@ module RuboCop
70
69
  message_argument&.source
71
70
  ].flatten.compact.join(', ')
72
71
 
73
- original_arguments = arguments.map(&:source).join(', ')
74
-
75
72
  format(
76
73
  MSG,
77
- new_arguments: new_arguments,
78
- original_arguments: original_arguments
74
+ new_arguments: new_arguments
79
75
  )
80
76
  end
81
77
 
@@ -10,17 +10,6 @@ module RuboCop
10
10
 
11
11
  ASSERTION_PREFIXES = %w[assert refute].freeze
12
12
 
13
- ASSERTION_METHODS = %i[
14
- assert assert_empty assert_equal assert_in_delta assert_in_epsilon assert_includes assert_instance_of
15
- assert_kind_of assert_match assert_nil assert_operator assert_output assert_path_exists assert_predicate
16
- assert_raises assert_respond_to assert_same assert_send assert_silent assert_throws
17
- refute refute_empty refute_equal refute_in_delta refute_in_epsilon refute_includes refute_instance_of
18
- refute_kind_of refute_match refute_nil refute_operator refute_path_exists refute_predicate
19
- refute_respond_to refute_same
20
- ].freeze
21
-
22
- FLUNK = 'flunk'
23
-
24
13
  LIFECYCLE_HOOK_METHODS = %i[
25
14
  before_setup
26
15
  setup
@@ -84,19 +73,18 @@ module RuboCop
84
73
  method_def.each_child_node(:send)
85
74
  end
86
75
 
87
- send_nodes.select { |send_node| assertion?(send_node) }
76
+ send_nodes.select { |send_node| assertion_method?(send_node) }
88
77
  end
89
78
 
90
- def assertion?(node)
91
- node.send_type? &&
92
- ASSERTION_PREFIXES.any? do |prefix|
93
- method_name = node.method_name.to_s
94
- method_name == FLUNK || method_name.start_with?(prefix)
95
- end
96
- end
79
+ def assertion_method?(node)
80
+ return false unless node.send_type?
81
+
82
+ ASSERTION_PREFIXES.any? do |prefix|
83
+ method_name = node.method_name
97
84
 
98
- def assertion_method?(method_name)
99
- method_name == FLUNK || ASSERTION_METHODS.include?(method_name)
85
+ # TODO: Remove the fllowing `to_s` since Ruby 2.7 that supports `Symbol#start_with?`.
86
+ method_name.to_s.start_with?(prefix) || node.method?(:flunk)
87
+ end
100
88
  end
101
89
 
102
90
  def lifecycle_hook_method?(node)
@@ -5,7 +5,7 @@ module RuboCop
5
5
  module Minitest
6
6
  # Common functionality for `AssertNil` and `RefuteNil` cops.
7
7
  module NilAssertionHandleable
8
- MSG = 'Prefer using `%<assertion_type>s_nil(%<preferred_args>s)` over `%<method>s(%<current_args>s)`.'
8
+ MSG = 'Prefer using `%<assertion_type>s_nil(%<preferred_args>s)`.'
9
9
 
10
10
  private
11
11
 
@@ -22,23 +22,18 @@ module RuboCop
22
22
  message_source = message&.source
23
23
 
24
24
  preferred_args = [actual.source, message_source].compact
25
- current_args = if comparison_assertion_method?(node)
26
- ['nil', preferred_args].join(', ')
27
- else
28
- ["#{actual.source}.nil?", message_source].compact.join(', ')
29
- end
30
25
 
31
26
  format(
32
27
  MSG,
33
28
  assertion_type: assertion_type,
34
29
  preferred_args: preferred_args.join(', '),
35
- method: node.method_name, current_args: current_args
30
+ method: node.method_name
36
31
  )
37
32
  end
38
33
 
39
34
  def autocorrect(corrector, node, actual)
40
35
  corrector.replace(node.loc.selector, :"#{assertion_type}_nil")
41
- if comparison_assertion_method?(node)
36
+ if comparison_or_predicate_assertion_method?(node)
42
37
  corrector.replace(first_and_second_arguments_range(node), actual.source)
43
38
  else
44
39
  corrector.remove(node.first_argument.loc.dot)
@@ -46,8 +41,8 @@ module RuboCop
46
41
  end
47
42
  end
48
43
 
49
- def comparison_assertion_method?(node)
50
- node.method?(:"#{assertion_type}_equal")
44
+ def comparison_or_predicate_assertion_method?(node)
45
+ node.method?(:"#{assertion_type}_equal") || node.method?(:"#{assertion_type}_predicate")
51
46
  end
52
47
  end
53
48
  end
@@ -0,0 +1,61 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RuboCop
4
+ module Cop
5
+ module Minitest
6
+ # Common functionality for `Minitest/AssertPredicate` and `Minitest/RefutePredicate` cops.
7
+ module PredicateAssertionHandleable
8
+ MSG = 'Prefer using `%<assertion_type>s_predicate(%<new_arguments>s)`.'
9
+ RESTRICT_ON_SEND = %i[assert].freeze
10
+
11
+ def on_send(node)
12
+ return unless (arguments = peel_redundant_parentheses_from(node.arguments))
13
+ return unless arguments.first.respond_to?(:predicate_method?) && arguments.first.predicate_method?
14
+ return unless arguments.first.arguments.count.zero?
15
+
16
+ add_offense(node, message: offense_message(arguments)) do |corrector|
17
+ autocorrect(corrector, node, arguments)
18
+ end
19
+ end
20
+
21
+ def autocorrect(corrector, node, arguments)
22
+ corrector.replace(node.loc.selector, "#{assertion_type}_predicate")
23
+
24
+ new_arguments = new_arguments(arguments).join(', ')
25
+
26
+ corrector.replace(first_argument_range(node), new_arguments)
27
+ end
28
+
29
+ private
30
+
31
+ def peel_redundant_parentheses_from(arguments)
32
+ return arguments unless arguments.first&.begin_type?
33
+
34
+ peel_redundant_parentheses_from(arguments.first.children)
35
+ end
36
+
37
+ def offense_message(arguments)
38
+ message_argument = arguments.last if arguments.first != arguments.last
39
+
40
+ new_arguments = [
41
+ new_arguments(arguments),
42
+ message_argument&.source
43
+ ].flatten.compact.join(', ')
44
+
45
+ format(MSG, assertion_type: assertion_type, new_arguments: new_arguments)
46
+ end
47
+
48
+ def new_arguments(arguments)
49
+ receiver = correct_receiver(arguments.first.receiver)
50
+ method_name = arguments.first.method_name
51
+
52
+ [receiver, ":#{method_name}"]
53
+ end
54
+
55
+ def correct_receiver(receiver)
56
+ receiver ? receiver.source : 'self'
57
+ end
58
+ end
59
+ end
60
+ end
61
+ end
@@ -22,7 +22,7 @@ module RuboCop
22
22
  # class FooTest < Minitest::Test
23
23
  # def test_do_something
24
24
  # assert_equal(nil, somestuff)
25
- # ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Prefer using `assert_nil(somestuff)` over `assert_equal(nil, somestuff)`.
25
+ # ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Prefer using `assert_nil(somestuff)`.
26
26
  # end
27
27
  # end
28
28
  # RUBY
@@ -36,7 +36,7 @@ module RuboCop
36
36
  # class FooTest < Minitest::Test
37
37
  # def test_do_something
38
38
  # assert_equal(nil, somestuff)
39
- # ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Prefer using `assert_nil(somestuff)` over `assert_equal(nil, somestuff)`.
39
+ # ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Prefer using `assert_nil(somestuff)`.
40
40
  # end
41
41
  # end
42
42
  # RUBY
@@ -64,7 +64,7 @@ module RuboCop
64
64
  # class FooTest < Minitest::Test
65
65
  # def test_do_something
66
66
  # assert_equal(nil, somestuff)
67
- # ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Prefer using `assert_nil(somestuff)` over `assert_equal(nil, somestuff)`.
67
+ # ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Prefer using `assert_nil(somestuff)`.
68
68
  # end
69
69
  # end
70
70
  # RUBY
@@ -4,7 +4,7 @@ module RuboCop
4
4
  module Minitest
5
5
  # This module holds the RuboCop Minitest version information.
6
6
  module Version
7
- STRING = '0.17.0'
7
+ STRING = '0.18.0'
8
8
 
9
9
  def self.document_version
10
10
  STRING.match('\d+\.\d+').to_s
data/mkdocs.yml CHANGED
@@ -1,13 +1,13 @@
1
1
  site_name: "A RuboCop extension focused on enforcing Minitest best practices and coding conventions."
2
2
  repo_url: https://github.com/rubocop/rubocop-minitest
3
3
  edit_uri: edit/master/legacy-docs/
4
- copyright: "Copyright &copy; 2021 Bozhidar Batsov, Jonas Arvidsson, Koichi ITO, and RuboCop contributors"
4
+ copyright: "Copyright &copy; 2022 Bozhidar Batsov, Jonas Arvidsson, Koichi ITO, and RuboCop contributors"
5
5
  docs_dir: legacy-docs
6
6
  pages:
7
- - Home: index.md
8
- - Installation: installation.md
9
- - Usage: usage.md
10
- - Cops: cops.md
11
- - Cops Documentation:
12
- - Minitest Cops: cops_minitest.md
7
+ - Home: index.md
8
+ - Installation: installation.md
9
+ - Usage: usage.md
10
+ - Cops: cops.md
11
+ - Cops Documentation:
12
+ - Minitest Cops: cops_minitest.md
13
13
  theme: readthedocs
@@ -0,0 +1,5 @@
1
+ ### Changes
2
+
3
+ * [#158](https://github.com/rubocop/rubocop-minitest/pull/158): Make `Minitest/UnreachableAssertion` aware of `assert` and `refute` prefix methods. ([@koic][])
4
+
5
+ [@koic]: https://github.com/koic
@@ -0,0 +1,5 @@
1
+ ### Bug fixes
2
+
3
+ * [#159](https://github.com/rubocop/rubocop-minitest/issues/159): Fix a false positive for `Minitest/UnreachableAssertion` when using only one assertion method in `assert_raises` block. ([@koic][])
4
+
5
+ [@koic]: https://github.com/koic
@@ -0,0 +1,9 @@
1
+ ### New features
2
+
3
+ * [#161](https://github.com/rubocop/rubocop-minitest/pull/161): Add new `Minitest/AssertPredicate` and `Minitest/RefutePredicate` cops. ([@koic][])
4
+
5
+ ### Changes
6
+
7
+ * [#162](https://github.com/rubocop/rubocop-minitest/pull/162): Make `Minitest/AssertNil` (`Minitest/RefuteNil`) aware of `assert_predicate(obj, :nil?)` (`refute_predicate(obj, :nil?)`). ([@koic][])
8
+
9
+ [@koic]: https://github.com/koic
@@ -12,12 +12,12 @@ end
12
12
 
13
13
  task update_cops_documentation: :yard_for_generate_documentation do
14
14
  deps = ['Minitest']
15
- CopsDocumentationGenerator.new(departments: deps).call
16
- end
17
15
 
18
- desc 'Generate docs of all cops departments (obsolete)'
19
- task :generate_cops_documentation do
20
- puts 'Updating the documentation is now done automatically!'
16
+ # NOTE: Update `<<next>>` version for docs/modules/ROOT/pages/cops_minitest.adoc
17
+ # when running release tasks.
18
+ RuboCop::Minitest::Inject.defaults!
19
+
20
+ CopsDocumentationGenerator.new(departments: deps).call
21
21
  end
22
22
 
23
23
  desc 'Syntax check for the documentation comments'
@@ -39,7 +39,7 @@ namespace :cut_release do
39
39
 
40
40
  File.open('docs/antora.yml', 'w') do |f|
41
41
  f << antora_metadata.sub(
42
- 'version: master',
42
+ "version: 'master'",
43
43
  "version: '#{version_sans_patch(new_version)}'"
44
44
  )
45
45
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubocop-minitest
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.17.0
4
+ version: 0.18.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bozhidar Batsov
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: exe
12
12
  cert_chain: []
13
- date: 2021-11-22 00:00:00.000000000 Z
13
+ date: 2022-03-13 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rubocop
@@ -60,10 +60,12 @@ files:
60
60
  - ".github/ISSUE_TEMPLATE/bug_report.md"
61
61
  - ".github/ISSUE_TEMPLATE/feature_request.md"
62
62
  - ".github/PULL_REQUEST_TEMPLATE.md"
63
+ - ".github/workflows/linting.yml"
63
64
  - ".github/workflows/spell_checking.yml"
64
65
  - ".gitignore"
65
66
  - ".rubocop.yml"
66
67
  - ".rubocop_todo.yml"
68
+ - ".yamllint.yml"
67
69
  - ".yardopts"
68
70
  - CHANGELOG.md
69
71
  - CONTRIBUTING.md
@@ -100,6 +102,7 @@ files:
100
102
  - lib/rubocop/cop/minitest/assert_nil.rb
101
103
  - lib/rubocop/cop/minitest/assert_output.rb
102
104
  - lib/rubocop/cop/minitest/assert_path_exists.rb
105
+ - lib/rubocop/cop/minitest/assert_predicate.rb
103
106
  - lib/rubocop/cop/minitest/assert_respond_to.rb
104
107
  - lib/rubocop/cop/minitest/assert_silent.rb
105
108
  - lib/rubocop/cop/minitest/assert_truthy.rb
@@ -119,6 +122,7 @@ files:
119
122
  - lib/rubocop/cop/minitest/refute_match.rb
120
123
  - lib/rubocop/cop/minitest/refute_nil.rb
121
124
  - lib/rubocop/cop/minitest/refute_path_exists.rb
125
+ - lib/rubocop/cop/minitest/refute_predicate.rb
122
126
  - lib/rubocop/cop/minitest/refute_respond_to.rb
123
127
  - lib/rubocop/cop/minitest/test_method_name.rb
124
128
  - lib/rubocop/cop/minitest/unreachable_assertion.rb
@@ -129,6 +133,7 @@ files:
129
133
  - lib/rubocop/cop/mixin/minitest_cop_rule.rb
130
134
  - lib/rubocop/cop/mixin/minitest_exploration_helpers.rb
131
135
  - lib/rubocop/cop/mixin/nil_assertion_handleable.rb
136
+ - lib/rubocop/cop/mixin/predicate_assertion_handleable.rb
132
137
  - lib/rubocop/minitest.rb
133
138
  - lib/rubocop/minitest/assert_offense.rb
134
139
  - lib/rubocop/minitest/inject.rb
@@ -152,6 +157,9 @@ files:
152
157
  - relnotes/v0.15.2.md
153
158
  - relnotes/v0.16.0.md
154
159
  - relnotes/v0.17.0.md
160
+ - relnotes/v0.17.1.md
161
+ - relnotes/v0.17.2.md
162
+ - relnotes/v0.18.0.md
155
163
  - relnotes/v0.2.0.md
156
164
  - relnotes/v0.2.1.md
157
165
  - relnotes/v0.3.0.md
@@ -178,7 +186,7 @@ metadata:
178
186
  homepage_uri: https://docs.rubocop.org/rubocop-minitest/
179
187
  changelog_uri: https://github.com/rubocop/rubocop-minitest/blob/master/CHANGELOG.md
180
188
  source_code_uri: https://github.com/rubocop/rubocop-minitest
181
- documentation_uri: https://docs.rubocop.org/rubocop-minitest/0.17
189
+ documentation_uri: https://docs.rubocop.org/rubocop-minitest/0.18
182
190
  bug_tracker_uri: https://github.com/rubocop/rubocop-minitest/issues
183
191
  rubygems_mfa_required: 'true'
184
192
  post_install_message:
@@ -196,7 +204,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
196
204
  - !ruby/object:Gem::Version
197
205
  version: '0'
198
206
  requirements: []
199
- rubygems_version: 3.3.0.dev
207
+ rubygems_version: 3.3.3
200
208
  signing_key:
201
209
  specification_version: 4
202
210
  summary: Automatic Minitest code style checking tool.