rubocop-minitest 0.20.0 → 0.20.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: 6c35365ef5838d4a75f01181865e860ecb774a73288a310ffe2bfec21b6c6001
4
- data.tar.gz: ccbdb0bb831bcebec0cde35263bf90063e400a25d97bccb9facf3edbc0bbd23a
3
+ metadata.gz: d780d9c08b215f247a19ffc039d8385b58f63037585c882e3b760cdbe511ae14
4
+ data.tar.gz: 1ea02089d0b9a3511cbc19a3222f3c55e86a3c17d05bdc05291281df8115500a
5
5
  SHA512:
6
- metadata.gz: 0a85bb1c4f0226eb025cdf18ae72757403ea71b422b19291e80bf696c95735cb2ddd3f61f921ad01c04c88ef731aa3e39d68141ac8971315e5933575cab6ec8c
7
- data.tar.gz: b449004eb3a26c8996490d5e5008e784f10660edba75e99a7b3d5ef317d6c4585757aee59e7c95fb7100d892a2769c88bf26f42ac96684488945a5e9ee775155
6
+ metadata.gz: 241d069163e52ba35fc4edb2c96d3f7fca6a32fa84ced1feee2abf777d42561503b309371444b81da318c3f07bce469a89e12fc2f6d0295372c3249c41db1ff1
7
+ data.tar.gz: 76ec782b3a226848f6676266dfbd1f06dc0cf2bbd999f01f9c46096def25cfe188c7dddb95ca93ab737812ef6eae81fd8401872b8a243344e1903c50143a699c
data/CHANGELOG.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  ## master (unreleased)
4
4
 
5
+ ## 0.20.1 (2022-06-13)
6
+
7
+ ### Bug fixes
8
+
9
+ * [#175](https://github.com/rubocop/rubocop-minitest/pull/175): Fix raise error when using assert with block. ([@ippachi][])
10
+
5
11
  ## 0.20.0 (2022-05-29)
6
12
 
7
13
  ### New features
@@ -314,3 +320,4 @@
314
320
  [@gi]: https://github.com/gi
315
321
  [@ignacio-chiazzo]: https://github.com/ignacio-chiazzo
316
322
  [@gjtorikian]: https://github.com/gjtorikian
323
+ [@ippachi]: https://github.com/ippachi
@@ -619,7 +619,7 @@ and autocorrects them to use expect format.
619
619
 
620
620
  === Examples
621
621
 
622
- ==== EnforcedStyle: _
622
+ ==== EnforcedStyle: any (default)
623
623
 
624
624
  [source,ruby]
625
625
  ----
@@ -628,6 +628,11 @@ musts.must_equal expected_musts
628
628
  wonts.wont_match expected_wonts
629
629
  musts.must_raise TypeError
630
630
 
631
+ # good
632
+ _(musts).must_equal expected_musts
633
+ _(wonts).wont_match expected_wonts
634
+ _ { musts }.must_raise TypeError
635
+
631
636
  expect(musts).must_equal expected_musts
632
637
  expect(wonts).wont_match expected_wonts
633
638
  expect { musts }.must_raise TypeError
@@ -635,14 +640,9 @@ expect { musts }.must_raise TypeError
635
640
  value(musts).must_equal expected_musts
636
641
  value(wonts).wont_match expected_wonts
637
642
  value { musts }.must_raise TypeError
638
-
639
- # good
640
- _(musts).must_equal expected_musts
641
- _(wonts).wont_match expected_wonts
642
- _ { musts }.must_raise TypeError
643
643
  ----
644
644
 
645
- ==== EnforcedStyle: any (default)
645
+ ==== EnforcedStyle: _
646
646
 
647
647
  [source,ruby]
648
648
  ----
@@ -651,11 +651,6 @@ musts.must_equal expected_musts
651
651
  wonts.wont_match expected_wonts
652
652
  musts.must_raise TypeError
653
653
 
654
- # good
655
- _(musts).must_equal expected_musts
656
- _(wonts).wont_match expected_wonts
657
- _ { musts }.must_raise TypeError
658
-
659
654
  expect(musts).must_equal expected_musts
660
655
  expect(wonts).wont_match expected_wonts
661
656
  expect { musts }.must_raise TypeError
@@ -663,6 +658,11 @@ expect { musts }.must_raise TypeError
663
658
  value(musts).must_equal expected_musts
664
659
  value(wonts).wont_match expected_wonts
665
660
  value { musts }.must_raise TypeError
661
+
662
+ # good
663
+ _(musts).must_equal expected_musts
664
+ _(wonts).wont_match expected_wonts
665
+ _ { musts }.must_raise TypeError
666
666
  ----
667
667
 
668
668
  ==== EnforcedStyle: expect
@@ -6,12 +6,17 @@ module RuboCop
6
6
  # Checks for deprecated global expectations
7
7
  # and autocorrects them to use expect format.
8
8
  #
9
- # @example EnforcedStyle: _
9
+ # @example EnforcedStyle: any (default)
10
10
  # # bad
11
11
  # musts.must_equal expected_musts
12
12
  # wonts.wont_match expected_wonts
13
13
  # musts.must_raise TypeError
14
14
  #
15
+ # # good
16
+ # _(musts).must_equal expected_musts
17
+ # _(wonts).wont_match expected_wonts
18
+ # _ { musts }.must_raise TypeError
19
+ #
15
20
  # expect(musts).must_equal expected_musts
16
21
  # expect(wonts).wont_match expected_wonts
17
22
  # expect { musts }.must_raise TypeError
@@ -20,22 +25,12 @@ module RuboCop
20
25
  # value(wonts).wont_match expected_wonts
21
26
  # value { musts }.must_raise TypeError
22
27
  #
23
- # # good
24
- # _(musts).must_equal expected_musts
25
- # _(wonts).wont_match expected_wonts
26
- # _ { musts }.must_raise TypeError
27
- #
28
- # @example EnforcedStyle: any (default)
28
+ # @example EnforcedStyle: _
29
29
  # # bad
30
30
  # musts.must_equal expected_musts
31
31
  # wonts.wont_match expected_wonts
32
32
  # musts.must_raise TypeError
33
33
  #
34
- # # good
35
- # _(musts).must_equal expected_musts
36
- # _(wonts).wont_match expected_wonts
37
- # _ { musts }.must_raise TypeError
38
- #
39
34
  # expect(musts).must_equal expected_musts
40
35
  # expect(wonts).wont_match expected_wonts
41
36
  # expect { musts }.must_raise TypeError
@@ -44,6 +39,11 @@ module RuboCop
44
39
  # value(wonts).wont_match expected_wonts
45
40
  # value { musts }.must_raise TypeError
46
41
  #
42
+ # # good
43
+ # _(musts).must_equal expected_musts
44
+ # _(wonts).wont_match expected_wonts
45
+ # _ { musts }.must_raise TypeError
46
+ #
47
47
  # @example EnforcedStyle: expect
48
48
  # # bad
49
49
  # musts.must_equal expected_musts
@@ -13,8 +13,9 @@ module RuboCop
13
13
 
14
14
  first_argument = arguments.first
15
15
 
16
+ return unless first_argument
16
17
  return if first_argument.block_type? || first_argument.numblock_type?
17
- return unless first_argument.respond_to?(:predicate_method?) && first_argument.predicate_method?
18
+ return unless predicate_method?(first_argument)
18
19
  return unless first_argument.arguments.count.zero?
19
20
 
20
21
  add_offense(node, message: offense_message(arguments)) do |corrector|
@@ -38,6 +39,10 @@ module RuboCop
38
39
  peel_redundant_parentheses_from(arguments.first.children)
39
40
  end
40
41
 
42
+ def predicate_method?(first_argument)
43
+ first_argument.respond_to?(:predicate_method?) && first_argument.predicate_method?
44
+ end
45
+
41
46
  def offense_message(arguments)
42
47
  message_argument = arguments.last if arguments.first != arguments.last
43
48
 
@@ -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.20.0'
7
+ STRING = '0.20.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
+ * [#175](https://github.com/rubocop/rubocop-minitest/pull/175): Fix raise error when using assert with block. ([@ippachi][])
4
+
5
+ [@ippachi]: https://github.com/ippachi
@@ -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: ~',
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.20.0
4
+ version: 0.20.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: 2022-05-28 00:00:00.000000000 Z
13
+ date: 2022-06-13 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rubocop
@@ -167,6 +167,7 @@ files:
167
167
  - relnotes/v0.2.0.md
168
168
  - relnotes/v0.2.1.md
169
169
  - relnotes/v0.20.0.md
170
+ - relnotes/v0.20.1.md
170
171
  - relnotes/v0.3.0.md
171
172
  - relnotes/v0.4.0.md
172
173
  - relnotes/v0.4.1.md