rubocop-rspec 2.23.1 → 2.23.2

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2d8e118064ce45e0670b72b711b2e680f511f645997f86c9d22dcf9f0eb564d7
4
- data.tar.gz: 8a0a510f390617e4e83e99bdbec1bc0146eb06b1b61c51aada05721154a6be43
3
+ metadata.gz: 2312779cc594656bb1473fc821f67c6a56ac6275c71ac536c5978a4ef4411384
4
+ data.tar.gz: 0a6419dba263c16228b454d84e25a6b066de368ebd96a98c0e2e9f66ff74f053
5
5
  SHA512:
6
- metadata.gz: 4a1f937488b43fe96496ec87d1a6fcc1d53385248937de31d1fb4a7923dd98a2769d225e23b7e8d5bd66c7c6e2c38fb5b3652c2792087f00999464a7161561fb
7
- data.tar.gz: 9b2fed4ef2b93e9ac867133aaa11efdfd66cea642416cd82cc2ca322875154c6a3f174991f1a2c49cf762cfcf9c0aa17635348ce5e8ff8c300103b8c727d33c1
6
+ metadata.gz: 1ed0d4251d930a51e2214b200f5720fa7f75b839e40164a6461992ee01e22518e435d12f2cd3c626f0af24c47b435bfce4f80765eadc1540e848c993a97cfae9
7
+ data.tar.gz: a74d40480225c7b693f33ff4237a19eb44188f6b634ee60cbec96cf89d03b356b61fa5130c2939a17a23331390edbe0b9f7ed4f6a2e08606bbe88d69b9631bf0
data/CHANGELOG.md CHANGED
@@ -2,6 +2,11 @@
2
2
 
3
3
  ## Master (Unreleased)
4
4
 
5
+ ## 2.23.2 (2023-08-09)
6
+
7
+ - Fix an incorrect autocorrect for `RSpec/ReceiveMessages` when method is only non-word character. ([@marocchino])
8
+ - Fix a false positive for `RSpec/ReceiveMessages` when return with splat. ([@marocchino])
9
+
5
10
  ## 2.23.1 (2023-08-07)
6
11
 
7
12
  - Mark to `Safe: false` for `RSpec/Rails/NegationBeValid` cop. ([@ydah])
@@ -843,6 +848,7 @@ Compatibility release so users can upgrade RuboCop to 0.51.0. No new features.
843
848
  [@lokhi]: https://github.com/lokhi
844
849
  [@luke-hill]: https://github.com/luke-hill
845
850
  [@m-yamashita01]: https://github.com/M-Yamashita01
851
+ [@marocchino]: https://github.com/marocchino
846
852
  [@miguelfteixeira]: https://github.com/miguelfteixeira
847
853
  [@mkenyon]: https://github.com/mkenyon
848
854
  [@mkrawc]: https://github.com/mkrawc
@@ -37,7 +37,7 @@ module RuboCop
37
37
 
38
38
  # @!method allow_receive_message?(node)
39
39
  def_node_matcher :allow_receive_message?, <<~PATTERN
40
- (send (send nil? :allow ...) :to (send (send nil? :receive (sym _)) :and_return !#heredoc?))
40
+ (send (send nil? :allow ...) :to (send (send nil? :receive (sym _)) :and_return !#heredoc_or_splat?))
41
41
  PATTERN
42
42
 
43
43
  # @!method allow_argument(node)
@@ -147,12 +147,13 @@ module RuboCop
147
147
  range_by_whole_lines(item.source_range, include_final_newline: true)
148
148
  end
149
149
 
150
- def heredoc?(node)
151
- (node.str_type? || node.dstr_type?) && node.heredoc?
150
+ def heredoc_or_splat?(node)
151
+ (node.str_type? || node.dstr_type?) && node.heredoc? ||
152
+ node.splat_type?
152
153
  end
153
154
 
154
155
  def requires_quotes?(value)
155
- value.match?(/^:".*?"|=$/)
156
+ value.match?(/^:".*?"|=$|^\W+$/)
156
157
  end
157
158
  end
158
159
  end
@@ -51,7 +51,8 @@ module RuboCop
51
51
  parent = expect.parent
52
52
  return true unless parent
53
53
  return true if parent.begin_type?
54
- return true if parent.block_type? && parent.body == expect
54
+
55
+ true if parent.block_type? && parent.body == expect
55
56
  end
56
57
  end
57
58
  end
@@ -4,7 +4,7 @@ module RuboCop
4
4
  module RSpec
5
5
  # Version information for the RSpec RuboCop plugin.
6
6
  module Version
7
- STRING = '2.23.1'
7
+ STRING = '2.23.2'
8
8
  end
9
9
  end
10
10
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubocop-rspec
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.23.1
4
+ version: 2.23.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Backus
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2023-08-07 00:00:00.000000000 Z
13
+ date: 2023-08-09 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rubocop