rubocop-rspec 2.23.0 → 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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2312779cc594656bb1473fc821f67c6a56ac6275c71ac536c5978a4ef4411384
|
4
|
+
data.tar.gz: 0a6419dba263c16228b454d84e25a6b066de368ebd96a98c0e2e9f66ff74f053
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1ed0d4251d930a51e2214b200f5720fa7f75b839e40164a6461992ee01e22518e435d12f2cd3c626f0af24c47b435bfce4f80765eadc1540e848c993a97cfae9
|
7
|
+
data.tar.gz: a74d40480225c7b693f33ff4237a19eb44188f6b634ee60cbec96cf89d03b356b61fa5130c2939a17a23331390edbe0b9f7ed4f6a2e08606bbe88d69b9631bf0
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,16 @@
|
|
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
|
+
|
10
|
+
## 2.23.1 (2023-08-07)
|
11
|
+
|
12
|
+
- Mark to `Safe: false` for `RSpec/Rails/NegationBeValid` cop. ([@ydah])
|
13
|
+
- Declare autocorrect as unsafe for `RSpec/ReceiveMessages`. ([@bquorning])
|
14
|
+
|
5
15
|
## 2.23.0 (2023-07-30)
|
6
16
|
|
7
17
|
- Add new `RSpec/Rails/NegationBeValid` cop. ([@ydah])
|
@@ -838,6 +848,7 @@ Compatibility release so users can upgrade RuboCop to 0.51.0. No new features.
|
|
838
848
|
[@lokhi]: https://github.com/lokhi
|
839
849
|
[@luke-hill]: https://github.com/luke-hill
|
840
850
|
[@m-yamashita01]: https://github.com/M-Yamashita01
|
851
|
+
[@marocchino]: https://github.com/marocchino
|
841
852
|
[@miguelfteixeira]: https://github.com/miguelfteixeira
|
842
853
|
[@mkenyon]: https://github.com/mkenyon
|
843
854
|
[@mkrawc]: https://github.com/mkrawc
|
data/config/default.yml
CHANGED
@@ -733,6 +733,7 @@ RSpec/ReceiveCounts:
|
|
733
733
|
RSpec/ReceiveMessages:
|
734
734
|
Description: Checks for multiple messages stubbed on the same object.
|
735
735
|
Enabled: pending
|
736
|
+
SafeAutoCorrect: false
|
736
737
|
VersionAdded: '2.23'
|
737
738
|
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ReceiveMessages
|
738
739
|
|
@@ -1108,6 +1109,7 @@ RSpec/Rails/MinitestAssertions:
|
|
1108
1109
|
|
1109
1110
|
RSpec/Rails/NegationBeValid:
|
1110
1111
|
Description: Enforces use of `be_invalid` or `not_to` for negated be_valid.
|
1112
|
+
Safe: false
|
1111
1113
|
EnforcedStyle: not_to
|
1112
1114
|
SupportedStyles:
|
1113
1115
|
- not_to
|
@@ -6,6 +6,10 @@ module RuboCop
|
|
6
6
|
module Rails
|
7
7
|
# Enforces use of `be_invalid` or `not_to` for negated be_valid.
|
8
8
|
#
|
9
|
+
# @safety
|
10
|
+
# This cop is unsafe because it cannot guarantee that
|
11
|
+
# the test target is an instance of `ActiveModel::Validations``.
|
12
|
+
#
|
9
13
|
# @example EnforcedStyle: not_to (default)
|
10
14
|
# # bad
|
11
15
|
# expect(foo).to be_invalid
|
@@ -5,6 +5,11 @@ module RuboCop
|
|
5
5
|
module RSpec
|
6
6
|
# Checks for multiple messages stubbed on the same object.
|
7
7
|
#
|
8
|
+
# @safety
|
9
|
+
# The autocorrection is marked as unsafe, because it may change the
|
10
|
+
# order of stubs. This in turn may cause e.g. variables to be called
|
11
|
+
# before they are defined.
|
12
|
+
#
|
8
13
|
# @example
|
9
14
|
# # bad
|
10
15
|
# before do
|
@@ -32,7 +37,7 @@ module RuboCop
|
|
32
37
|
|
33
38
|
# @!method allow_receive_message?(node)
|
34
39
|
def_node_matcher :allow_receive_message?, <<~PATTERN
|
35
|
-
(send (send nil? :allow ...) :to (send (send nil? :receive (sym _)) :and_return !#
|
40
|
+
(send (send nil? :allow ...) :to (send (send nil? :receive (sym _)) :and_return !#heredoc_or_splat?))
|
36
41
|
PATTERN
|
37
42
|
|
38
43
|
# @!method allow_argument(node)
|
@@ -142,12 +147,13 @@ module RuboCop
|
|
142
147
|
range_by_whole_lines(item.source_range, include_final_newline: true)
|
143
148
|
end
|
144
149
|
|
145
|
-
def
|
146
|
-
(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?
|
147
153
|
end
|
148
154
|
|
149
155
|
def requires_quotes?(value)
|
150
|
-
value.match?(/^:".*?"
|
156
|
+
value.match?(/^:".*?"|=$|^\W+$/)
|
151
157
|
end
|
152
158
|
end
|
153
159
|
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.
|
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-
|
13
|
+
date: 2023-08-09 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rubocop
|