rubocop-minitest 0.32.0 → 0.32.2

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: 3581920acff906161f98b5af290d613af4d257834817f55d6a607088754dc4d8
4
- data.tar.gz: 1d19f60506d3e2693ce52d4eaf63b8fa92b00f2a6eda4b499df7920559b29bf9
3
+ metadata.gz: ce290f7a13faed25c00a17d9daf8bcaf17e187599a075323fc99f8494c29c2bb
4
+ data.tar.gz: 9def860d52f65aed4e8923bcf2fd851a5188485986c7ad5bce44a9dc0d79b2d3
5
5
  SHA512:
6
- metadata.gz: 0c297aa12f347d2fb0ee9d6fcdf52728498f7d3d148fc4b1a3ad26f1c0f9329fbaf8773601d330670a69ab7a3dae19d9702e27c7f5ffff6fa8cc7519f669a7a6
7
- data.tar.gz: d69e427b9f613c07a87a83ae24fc694e3fba7322e3c44f4548771645879383a5f713cca74e56061c509c4a5229c633bc52a905af5f97fdcae6af576608be5c6a
6
+ metadata.gz: 8db20fcf7d8e58b564da63b85f6692c4a2be189ffeacdc654f4b18ea689416688442df945606c84f55e63b9007c8df51b4f173004a7ae145603733f6bac62c61
7
+ data.tar.gz: 41232dfbabd012e4edbe1e78b49f1846004246950773a6f06c50fff358cb71a79fbdcd95ed0657690387801331093606c2dabb376788368cf51438ff84846be4
@@ -18,9 +18,14 @@ module RuboCop
18
18
 
19
19
  MSG = 'Prefer using `assert_operator(%<new_arguments>s)`.'
20
20
  RESTRICT_ON_SEND = %i[assert].freeze
21
+ ALLOWED_OPERATORS = [:[]].freeze
21
22
 
22
23
  def on_send(node)
23
- return unless node.first_argument.operator_method?
24
+ first_argument = node.first_argument
25
+ return unless first_argument.respond_to?(:binary_operation?) && first_argument.binary_operation?
26
+
27
+ operator = first_argument.to_a[1]
28
+ return if ALLOWED_OPERATORS.include?(operator)
24
29
 
25
30
  new_arguments = build_new_arguments(node)
26
31
 
@@ -18,9 +18,14 @@ module RuboCop
18
18
 
19
19
  MSG = 'Prefer using `refute_operator(%<new_arguments>s)`.'
20
20
  RESTRICT_ON_SEND = %i[refute].freeze
21
+ ALLOWED_OPERATORS = [:[]].freeze
21
22
 
22
23
  def on_send(node)
23
- return unless node.first_argument.operator_method?
24
+ first_argument = node.first_argument
25
+ return unless first_argument.respond_to?(:binary_operation?) && first_argument.binary_operation?
26
+
27
+ operator = first_argument.to_a[1]
28
+ return if ALLOWED_OPERATORS.include?(operator)
24
29
 
25
30
  new_arguments = build_new_arguments(node)
26
31
 
@@ -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.32.0'
7
+ STRING = '0.32.2'
8
8
 
9
9
  def self.document_version
10
10
  STRING.match('\d+\.\d+').to_s
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.32.0
4
+ version: 0.32.2
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: 2023-09-23 00:00:00.000000000 Z
13
+ date: 2023-09-27 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rubocop