rubocop-rspec_parity 1.4.0 → 1.4.1
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: 944e7c309cb2d5e95c94878066fdee5483054e1585bf272116825603ac2fc265
|
|
4
|
+
data.tar.gz: e72069e31fc0ee1b0b63db9d33f316cb9a5b3d52dcfd8d6de65071d406f3514e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 0d6e482836054a7069f89f2a2a350c70579c5459c58897d7cd4f539c670f3099512e71efc93f26fde2877d1582dfa3a2e238f0ba355c3a449ef50b1417379e61
|
|
7
|
+
data.tar.gz: 91eac7edad8d9d7f54fd3e3c7b0bb8973fa89e4c3d33ddd869c9db36ab0d6ae607162e4c7e097cd6203b541bc57ee39d01905598f69b629ff899e4293ccb4bfc
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
## [Unreleased]
|
|
2
2
|
|
|
3
|
+
## [1.4.1] - 2026-03-03
|
|
4
|
+
|
|
5
|
+
Fixed: `PublicMethodHasSpec` now reports violations even when the spec file does not exist, since a missing spec file means the method is untested
|
|
6
|
+
|
|
3
7
|
## [1.4.0] - 2026-03-03
|
|
4
8
|
|
|
5
9
|
Added: `FileHasSpec` cop that checks each app file has a corresponding spec file
|
|
@@ -202,11 +202,17 @@ module RuboCop
|
|
|
202
202
|
class_name = extract_class_name(node)
|
|
203
203
|
return unless class_name
|
|
204
204
|
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
205
|
+
all_expected = expected_spec_paths
|
|
206
|
+
spec_paths = find_valid_spec_files(class_name, all_expected)
|
|
208
207
|
method_name = node.method_name.to_s
|
|
209
208
|
|
|
209
|
+
if spec_paths.empty?
|
|
210
|
+
# No spec file exists — public method is untested
|
|
211
|
+
report_path = all_expected.first
|
|
212
|
+
add_method_offense(node, method_name, report_path, instance_method: instance_method) if report_path
|
|
213
|
+
return
|
|
214
|
+
end
|
|
215
|
+
|
|
210
216
|
# Check if relaxed validation applies
|
|
211
217
|
if matches_skip_path? && count_public_methods(node) == 1
|
|
212
218
|
# For single-method classes in configured paths, just check for examples
|