rubocop-minitest 0.15.0 → 0.15.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fa7a9c739cc54955a9c7647d8d5442c18f7888acb54212da90598fbec357717b
4
- data.tar.gz: 784f7adfaeb34d54fedeaedcadd528cdffb6c888569a1314082b2c93217b5f3f
3
+ metadata.gz: 95de9dbe9caf21c7034e137bdaf33e41000e9d418c70e889e3b108ae8aaff2bb
4
+ data.tar.gz: c58e39ff5277a4c511ba8c34a4378155efb185375edcba187f4c1eae8b44efbd
5
5
  SHA512:
6
- metadata.gz: b7bf8ad7fa1be35b461ab54c2097ccd4c6fd320f1b15341c253f527099afeebee139feb33007f6b471309aaad6bb0f6f4534a52e32b2e3bc0f45344a4e5588ef
7
- data.tar.gz: a73427443b2f4cb050f5e7893809f8026dbb41c4dc77461e6aa07fc13228e60f36a6bec7e893745eb14d911f143556003166028eb5abfcfea8f49b676ae50dbb
6
+ metadata.gz: 43a96338e7c17fab54a4e50d3f7cea66d52f18633f78f016987dc681e6aae197ec9899044dd310c7c0fe09859b7f861fa65bd4997112df1527ebc184f15f903d
7
+ data.tar.gz: 772dc16b3f51fd39c67618a49797f020765eafa6d18a6d74970950fc148ef774ef37c3771c055ff4921139ad7a7de1bb84615f6ba256933ff07008a9d624a7da
data/.rubocop.yml CHANGED
@@ -15,6 +15,10 @@ AllCops:
15
15
  InternalAffairs/NodeMatcherDirective:
16
16
  Enabled: false
17
17
 
18
+ # FIXME: Workaround for a false positive caused by this cop when using `bundle exec rake`.
19
+ InternalAffairs/UndefinedConfig:
20
+ Enabled: false
21
+
18
22
  Naming/PredicateName:
19
23
  # Method define macros for dynamically generated method.
20
24
  MethodDefinitionMacros:
@@ -91,6 +95,3 @@ Naming/FileName:
91
95
  Metrics/ModuleLength:
92
96
  Exclude:
93
97
  - 'test/**/*.rb'
94
-
95
- Performance/ChainArrayAllocation:
96
- Enabled: false
data/CHANGELOG.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  ## master (unreleased)
4
4
 
5
+ ## 0.15.1 (2021-09-26)
6
+
7
+ ### Bug fixes
8
+
9
+ * [#143](https://github.com/rubocop/rubocop-minitest/issues/143): Fix an error for `Minitest/LiteralAsActualArgumentTest` when expected and actual arguments are literals. ([@koic][])
10
+
5
11
  ## 0.15.0 (2021-08-09)
6
12
 
7
13
  ### New features
data/Rakefile CHANGED
@@ -24,12 +24,7 @@ Rake::TestTask.new do |t|
24
24
  end
25
25
 
26
26
  desc 'Run RuboCop over itself'
27
- RuboCop::RakeTask.new(:internal_investigation).tap do |task|
28
- if RUBY_ENGINE == 'ruby' &&
29
- RbConfig::CONFIG['host_os'] !~ /mswin|msys|mingw|cygwin|bccwin|wince|emc/
30
- task.options = %w[--parallel]
31
- end
32
- end
27
+ RuboCop::RakeTask.new(:internal_investigation)
33
28
 
34
29
  task default: %i[
35
30
  documentation_syntax_check
@@ -3,7 +3,7 @@
3
3
  == Minitest/AssertEmpty
4
4
 
5
5
  |===
6
- | Enabled by default | Safe | Supports autocorrection | VersionAdded | VersionChanged
6
+ | Enabled by default | Safe | Supports autocorrection | Version Added | Version Changed
7
7
 
8
8
  | Enabled
9
9
  | Yes
@@ -35,7 +35,7 @@ assert_empty(object, 'message')
35
35
  == Minitest/AssertEmptyLiteral
36
36
 
37
37
  |===
38
- | Enabled by default | Safe | Supports autocorrection | VersionAdded | VersionChanged
38
+ | Enabled by default | Safe | Supports autocorrection | Version Added | Version Changed
39
39
 
40
40
  | Enabled
41
41
  | Yes
@@ -62,7 +62,7 @@ assert_empty(object)
62
62
  == Minitest/AssertEqual
63
63
 
64
64
  |===
65
- | Enabled by default | Safe | Supports autocorrection | VersionAdded | VersionChanged
65
+ | Enabled by default | Safe | Supports autocorrection | Version Added | Version Changed
66
66
 
67
67
  | Enabled
68
68
  | Yes
@@ -92,7 +92,7 @@ assert_equal("rubocop-minitest", actual)
92
92
  == Minitest/AssertInDelta
93
93
 
94
94
  |===
95
- | Enabled by default | Safe | Supports autocorrection | VersionAdded | VersionChanged
95
+ | Enabled by default | Safe | Supports autocorrection | Version Added | Version Changed
96
96
 
97
97
  | Pending
98
98
  | Yes
@@ -124,7 +124,7 @@ assert_in_delta(0.2, actual, 0.001, 'message')
124
124
  == Minitest/AssertIncludes
125
125
 
126
126
  |===
127
- | Enabled by default | Safe | Supports autocorrection | VersionAdded | VersionChanged
127
+ | Enabled by default | Safe | Supports autocorrection | Version Added | Version Changed
128
128
 
129
129
  | Enabled
130
130
  | Yes
@@ -156,7 +156,7 @@ assert_includes(collection, object, 'message')
156
156
  == Minitest/AssertInstanceOf
157
157
 
158
158
  |===
159
- | Enabled by default | Safe | Supports autocorrection | VersionAdded | VersionChanged
159
+ | Enabled by default | Safe | Supports autocorrection | Version Added | Version Changed
160
160
 
161
161
  | Enabled
162
162
  | Yes
@@ -188,7 +188,7 @@ assert_instance_of(Class, object, 'message')
188
188
  == Minitest/AssertKindOf
189
189
 
190
190
  |===
191
- | Enabled by default | Safe | Supports autocorrection | VersionAdded | VersionChanged
191
+ | Enabled by default | Safe | Supports autocorrection | Version Added | Version Changed
192
192
 
193
193
  | Pending
194
194
  | Yes
@@ -220,7 +220,7 @@ assert_kind_of(Class, object, 'message')
220
220
  == Minitest/AssertMatch
221
221
 
222
222
  |===
223
- | Enabled by default | Safe | Supports autocorrection | VersionAdded | VersionChanged
223
+ | Enabled by default | Safe | Supports autocorrection | Version Added | Version Changed
224
224
 
225
225
  | Enabled
226
226
  | Yes
@@ -252,7 +252,7 @@ assert_match(matcher, string, 'message')
252
252
  == Minitest/AssertNil
253
253
 
254
254
  |===
255
- | Enabled by default | Safe | Supports autocorrection | VersionAdded | VersionChanged
255
+ | Enabled by default | Safe | Supports autocorrection | Version Added | Version Changed
256
256
 
257
257
  | Enabled
258
258
  | Yes
@@ -286,7 +286,7 @@ assert_nil(actual, 'message')
286
286
  == Minitest/AssertOutput
287
287
 
288
288
  |===
289
- | Enabled by default | Safe | Supports autocorrection | VersionAdded | VersionChanged
289
+ | Enabled by default | Safe | Supports autocorrection | Version Added | Version Changed
290
290
 
291
291
  | Pending
292
292
  | Yes
@@ -318,7 +318,7 @@ assert_output(expected) { puts object.method }
318
318
  == Minitest/AssertPathExists
319
319
 
320
320
  |===
321
- | Enabled by default | Safe | Supports autocorrection | VersionAdded | VersionChanged
321
+ | Enabled by default | Safe | Supports autocorrection | Version Added | Version Changed
322
322
 
323
323
  | Pending
324
324
  | Yes
@@ -350,7 +350,7 @@ assert_path_exists(path, 'message')
350
350
  == Minitest/AssertRespondTo
351
351
 
352
352
  |===
353
- | Enabled by default | Safe | Supports autocorrection | VersionAdded | VersionChanged
353
+ | Enabled by default | Safe | Supports autocorrection | Version Added | Version Changed
354
354
 
355
355
  | Enabled
356
356
  | Yes
@@ -384,7 +384,7 @@ assert_respond_to(self, :do_something)
384
384
  == Minitest/AssertSilent
385
385
 
386
386
  |===
387
- | Enabled by default | Safe | Supports autocorrection | VersionAdded | VersionChanged
387
+ | Enabled by default | Safe | Supports autocorrection | Version Added | Version Changed
388
388
 
389
389
  | Pending
390
390
  | Yes
@@ -414,7 +414,7 @@ assert_silent { puts object.do_something }
414
414
  == Minitest/AssertTruthy
415
415
 
416
416
  |===
417
- | Enabled by default | Safe | Supports autocorrection | VersionAdded | VersionChanged
417
+ | Enabled by default | Safe | Supports autocorrection | Version Added | Version Changed
418
418
 
419
419
  | Enabled
420
420
  | Yes
@@ -446,7 +446,7 @@ assert(actual, 'message')
446
446
  == Minitest/AssertWithExpectedArgument
447
447
 
448
448
  |===
449
- | Enabled by default | Safe | Supports autocorrection | VersionAdded | VersionChanged
449
+ | Enabled by default | Safe | Supports autocorrection | Version Added | Version Changed
450
450
 
451
451
  | Pending
452
452
  | No
@@ -478,7 +478,7 @@ assert(foo, 'message')
478
478
  == Minitest/AssertionInLifecycleHook
479
479
 
480
480
  |===
481
- | Enabled by default | Safe | Supports autocorrection | VersionAdded | VersionChanged
481
+ | Enabled by default | Safe | Supports autocorrection | Version Added | Version Changed
482
482
 
483
483
  | Pending
484
484
  | Yes
@@ -511,7 +511,7 @@ end
511
511
  == Minitest/GlobalExpectations
512
512
 
513
513
  |===
514
- | Enabled by default | Safe | Supports autocorrection | VersionAdded | VersionChanged
514
+ | Enabled by default | Safe | Supports autocorrection | Version Added | Version Changed
515
515
 
516
516
  | Enabled
517
517
  | Yes
@@ -545,7 +545,7 @@ _ { musts }.must_raise TypeError
545
545
  == Minitest/LiteralAsActualArgument
546
546
 
547
547
  |===
548
- | Enabled by default | Safe | Supports autocorrection | VersionAdded | VersionChanged
548
+ | Enabled by default | Safe | Supports autocorrection | Version Added | Version Changed
549
549
 
550
550
  | Pending
551
551
  | Yes
@@ -579,7 +579,7 @@ assert_equal [1, 2], foo, 'message'
579
579
  == Minitest/MultipleAssertions
580
580
 
581
581
  |===
582
- | Enabled by default | Safe | Supports autocorrection | VersionAdded | VersionChanged
582
+ | Enabled by default | Safe | Supports autocorrection | Version Added | Version Changed
583
583
 
584
584
  | Pending
585
585
  | Yes
@@ -630,7 +630,7 @@ end
630
630
  == Minitest/NoAssertions
631
631
 
632
632
  |===
633
- | Enabled by default | Safe | Supports autocorrection | VersionAdded | VersionChanged
633
+ | Enabled by default | Safe | Supports autocorrection | Version Added | Version Changed
634
634
 
635
635
  | Disabled
636
636
  | Yes
@@ -662,7 +662,7 @@ end
662
662
  == Minitest/RefuteEmpty
663
663
 
664
664
  |===
665
- | Enabled by default | Safe | Supports autocorrection | VersionAdded | VersionChanged
665
+ | Enabled by default | Safe | Supports autocorrection | Version Added | Version Changed
666
666
 
667
667
  | Enabled
668
668
  | Yes
@@ -694,7 +694,7 @@ refute_empty(object, 'message')
694
694
  == Minitest/RefuteEqual
695
695
 
696
696
  |===
697
- | Enabled by default | Safe | Supports autocorrection | VersionAdded | VersionChanged
697
+ | Enabled by default | Safe | Supports autocorrection | Version Added | Version Changed
698
698
 
699
699
  | Enabled
700
700
  | Yes
@@ -725,7 +725,7 @@ refute_equal("rubocop-minitest", actual)
725
725
  == Minitest/RefuteFalse
726
726
 
727
727
  |===
728
- | Enabled by default | Safe | Supports autocorrection | VersionAdded | VersionChanged
728
+ | Enabled by default | Safe | Supports autocorrection | Version Added | Version Changed
729
729
 
730
730
  | Enabled
731
731
  | Yes
@@ -760,7 +760,7 @@ refute(actual, 'message')
760
760
  == Minitest/RefuteInDelta
761
761
 
762
762
  |===
763
- | Enabled by default | Safe | Supports autocorrection | VersionAdded | VersionChanged
763
+ | Enabled by default | Safe | Supports autocorrection | Version Added | Version Changed
764
764
 
765
765
  | Pending
766
766
  | Yes
@@ -792,7 +792,7 @@ refute_in_delta(0.2, actual, 0.001, 'message')
792
792
  == Minitest/RefuteIncludes
793
793
 
794
794
  |===
795
- | Enabled by default | Safe | Supports autocorrection | VersionAdded | VersionChanged
795
+ | Enabled by default | Safe | Supports autocorrection | Version Added | Version Changed
796
796
 
797
797
  | Enabled
798
798
  | Yes
@@ -824,7 +824,7 @@ refute_includes(collection, object, 'message')
824
824
  == Minitest/RefuteInstanceOf
825
825
 
826
826
  |===
827
- | Enabled by default | Safe | Supports autocorrection | VersionAdded | VersionChanged
827
+ | Enabled by default | Safe | Supports autocorrection | Version Added | Version Changed
828
828
 
829
829
  | Enabled
830
830
  | Yes
@@ -856,7 +856,7 @@ refute_instance_of(Class, object, 'message')
856
856
  == Minitest/RefuteKindOf
857
857
 
858
858
  |===
859
- | Enabled by default | Safe | Supports autocorrection | VersionAdded | VersionChanged
859
+ | Enabled by default | Safe | Supports autocorrection | Version Added | Version Changed
860
860
 
861
861
  | Pending
862
862
  | Yes
@@ -888,7 +888,7 @@ refute_kind_of(Class, object, 'message')
888
888
  == Minitest/RefuteMatch
889
889
 
890
890
  |===
891
- | Enabled by default | Safe | Supports autocorrection | VersionAdded | VersionChanged
891
+ | Enabled by default | Safe | Supports autocorrection | Version Added | Version Changed
892
892
 
893
893
  | Enabled
894
894
  | Yes
@@ -920,7 +920,7 @@ refute_match(matcher, string, 'message')
920
920
  == Minitest/RefuteNil
921
921
 
922
922
  |===
923
- | Enabled by default | Safe | Supports autocorrection | VersionAdded | VersionChanged
923
+ | Enabled by default | Safe | Supports autocorrection | Version Added | Version Changed
924
924
 
925
925
  | Enabled
926
926
  | Yes
@@ -954,7 +954,7 @@ refute_nil(actual, 'message')
954
954
  == Minitest/RefutePathExists
955
955
 
956
956
  |===
957
- | Enabled by default | Safe | Supports autocorrection | VersionAdded | VersionChanged
957
+ | Enabled by default | Safe | Supports autocorrection | Version Added | Version Changed
958
958
 
959
959
  | Pending
960
960
  | Yes
@@ -986,7 +986,7 @@ refute_path_exists(path, 'message')
986
986
  == Minitest/RefuteRespondTo
987
987
 
988
988
  |===
989
- | Enabled by default | Safe | Supports autocorrection | VersionAdded | VersionChanged
989
+ | Enabled by default | Safe | Supports autocorrection | Version Added | Version Changed
990
990
 
991
991
  | Enabled
992
992
  | Yes
@@ -1020,7 +1020,7 @@ refute_respond_to(self, :do_something)
1020
1020
  == Minitest/TestMethodName
1021
1021
 
1022
1022
  |===
1023
- | Enabled by default | Safe | Supports autocorrection | VersionAdded | VersionChanged
1023
+ | Enabled by default | Safe | Supports autocorrection | Version Added | Version Changed
1024
1024
 
1025
1025
  | Pending
1026
1026
  | Yes
@@ -1060,7 +1060,7 @@ end
1060
1060
  == Minitest/UnreachableAssertion
1061
1061
 
1062
1062
  |===
1063
- | Enabled by default | Safe | Supports autocorrection | VersionAdded | VersionChanged
1063
+ | Enabled by default | Safe | Supports autocorrection | Version Added | Version Changed
1064
1064
 
1065
1065
  | Pending
1066
1066
  | Yes
@@ -1092,7 +1092,7 @@ assert_equal('foo', obj.bar)
1092
1092
  == Minitest/UnspecifiedException
1093
1093
 
1094
1094
  |===
1095
- | Enabled by default | Safe | Supports autocorrection | VersionAdded | VersionChanged
1095
+ | Enabled by default | Safe | Supports autocorrection | Version Added | Version Changed
1096
1096
 
1097
1097
  | Pending
1098
1098
  | Yes
@@ -27,17 +27,16 @@ module RuboCop
27
27
  def on_send(node)
28
28
  return unless node.method?(:assert_equal)
29
29
 
30
- actual = node.arguments[1]
30
+ expected, actual, message = *node.arguments
31
31
  return unless actual&.recursive_basic_literal?
32
+ return if expected.recursive_basic_literal?
32
33
 
33
34
  add_offense(all_arguments_range(node)) do |corrector|
34
- autocorrect(corrector, node)
35
+ autocorrect(corrector, node, expected, actual, message)
35
36
  end
36
37
  end
37
38
 
38
- def autocorrect(corrector, node)
39
- expected, actual, message = *node.arguments
40
-
39
+ def autocorrect(corrector, node, expected, actual, message)
41
40
  new_actual_source = if actual.hash_type? && !actual.braces?
42
41
  "{#{actual.source}}"
43
42
  else
@@ -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.15.0'
7
+ STRING = '0.15.1'
8
8
 
9
9
  def self.document_version
10
10
  STRING.match('\d+\.\d+').to_s
@@ -0,0 +1,5 @@
1
+ ### Bug fixes
2
+
3
+ * [#143](https://github.com/rubocop/rubocop-minitest/issues/143): Fix an error for `Minitest/LiteralAsActualArgumentTest` when expected and actual arguments are literals. ([@koic][])
4
+
5
+ [@koic]: https://github.com/koic
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.15.0
4
+ version: 0.15.1
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-08-09 00:00:00.000000000 Z
13
+ date: 2021-09-26 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rubocop
@@ -143,6 +143,7 @@ files:
143
143
  - relnotes/v0.13.0.md
144
144
  - relnotes/v0.14.0.md
145
145
  - relnotes/v0.15.0.md
146
+ - relnotes/v0.15.1.md
146
147
  - relnotes/v0.2.0.md
147
148
  - relnotes/v0.2.1.md
148
149
  - relnotes/v0.3.0.md
@@ -184,7 +185,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
184
185
  - !ruby/object:Gem::Version
185
186
  version: '0'
186
187
  requirements: []
187
- rubygems_version: 3.2.18
188
+ rubygems_version: 3.3.0.dev
188
189
  signing_key:
189
190
  specification_version: 4
190
191
  summary: Automatic Minitest code style checking tool.