rubocop-rspec_parity 1.3.4 → 1.3.5
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 +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/rubocop/cop/rspec_parity/public_method_has_spec.rb +10 -1
- data/lib/rubocop/rspec_parity/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 405b1cf99501c2de2098e7f7349191811bc882a303cad1081923d80ca93b9944
|
|
4
|
+
data.tar.gz: 9a6fd07fd98b90b5e6f124191888eff19ed380eb3c3827594b78ca631e29c77f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 34c8cb1ead5f2dd51ab8bce3b2fbd0f3cc3030cdb6d13b77164c8b19ef9c26fe35275da0ec78ebb9a94ce57620639879ded4f2d95650dd1362512d73261f8394
|
|
7
|
+
data.tar.gz: 9bdea0f802338bed6fa80c5593e1577758e7e4aeb06a03e28779193ae71cef90360c602ec6ed06f17e54405bead119c2901fc9edd618db96d89a3f799ce89833
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
## [Unreleased]
|
|
2
2
|
|
|
3
|
+
## [1.3.5] - 2026-03-02
|
|
4
|
+
|
|
5
|
+
Fixed: `PublicMethodHasSpec` now correctly recognizes `private` declarations inside `included do`, `class_eval do`, and `module_eval do` blocks as visibility scopes
|
|
6
|
+
|
|
3
7
|
## [1.3.4] - 2026-02-23
|
|
4
8
|
|
|
5
9
|
Added: `PublicMethodHasSpec` now treats methods inside `class_methods do` blocks (ActiveSupport::Concern) as class methods, expecting `.method_name` in specs
|
|
@@ -134,7 +134,8 @@ module RuboCop
|
|
|
134
134
|
|
|
135
135
|
def find_enclosing_scope(node)
|
|
136
136
|
node.each_ancestor.find do |n|
|
|
137
|
-
n.class_type? || n.module_type? || n.sclass_type? || class_methods_block?(n)
|
|
137
|
+
n.class_type? || n.module_type? || n.sclass_type? || class_methods_block?(n) || included_block?(n) ||
|
|
138
|
+
eval_block?(n)
|
|
138
139
|
end
|
|
139
140
|
end
|
|
140
141
|
|
|
@@ -142,6 +143,14 @@ module RuboCop
|
|
|
142
143
|
node.block_type? && node.send_node.method_name == :class_methods
|
|
143
144
|
end
|
|
144
145
|
|
|
146
|
+
def included_block?(node)
|
|
147
|
+
node.block_type? && node.send_node.method_name == :included
|
|
148
|
+
end
|
|
149
|
+
|
|
150
|
+
def eval_block?(node)
|
|
151
|
+
node.block_type? && %i[class_eval module_eval].include?(node.send_node.method_name)
|
|
152
|
+
end
|
|
153
|
+
|
|
145
154
|
def find_class_or_module(node)
|
|
146
155
|
node.each_ancestor.find { |n| n.class_type? || n.module_type? }
|
|
147
156
|
end
|