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: 6a5de925a1a0fb2a5857e4c6b8e021abeac3fe0e7f792c536497db7468382375
4
- data.tar.gz: 32c20a277a217ffa24a011ae7fa178ea81c5db9d99a74076686d56504d243043
3
+ metadata.gz: 944e7c309cb2d5e95c94878066fdee5483054e1585bf272116825603ac2fc265
4
+ data.tar.gz: e72069e31fc0ee1b0b63db9d33f316cb9a5b3d52dcfd8d6de65071d406f3514e
5
5
  SHA512:
6
- metadata.gz: 177de764d463e227cf080453bec0d526a339f8c86dc10cb75a86a6d03b7bc49cfb5a69837949285b9e5e9d016e355b1eb0b4b72e5e8beb80b3fef07bd98fd5dd
7
- data.tar.gz: d3dd4830f5c4640f2af0fa407552b0c81bd0fac8d5a933498eebd4b6c4536138cf06f92a903024de08977dadb55ebcd4b530e4e7bdaa0108bb6cfa380e12fc05
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
- spec_paths = find_valid_spec_files(class_name, expected_spec_paths)
206
- return if spec_paths.empty?
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
@@ -2,6 +2,6 @@
2
2
 
3
3
  module RuboCop
4
4
  module RSpecParity
5
- VERSION = "1.4.0"
5
+ VERSION = "1.4.1"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubocop-rspec_parity
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.0
4
+ version: 1.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Povilas Jurcys