specguard-ruby 0.3.6 → 0.3.8

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: a0b4156ddf8b2beed6ac009599c80e2be04d0ce213c44bd020bcf58c7bbb5bca
4
- data.tar.gz: 21c4cad8aa165736d247e3092bb22480d3502525cb89d5e7e183f1bf69db69f2
3
+ metadata.gz: df7e70603cb326ea7db7783c95263a418f42b2a2472c81af5013942e31e4a936
4
+ data.tar.gz: e586dcea9b754ec7f953c4cbf9c24f661fc410916551cca16e5cfc39a80941b9
5
5
  SHA512:
6
- metadata.gz: 938b3a7dd2a6f20d75a1493346668ce07236a4db6e0d867d35166dc42c9efe1e76581550793ab475ca21c14ae0006cb5668f2755174f10c00c49de108a90ea63
7
- data.tar.gz: 0b00056261a247ac2f3c31484a918fb371cc4abb05c2f0a2c2b932148633a1a57b3fa487a6d95d150e25066e23ca5952fcc575a6aaa03059224c3092b8b740e1
6
+ metadata.gz: 7e5ca1fac05f5891a127a59bf052b2c7840738880a6d2f94c0aaa608cfb5f967af5aec59910c340af09c19fae22a791d12941071ba826d93a8cf04c171380e4a
7
+ data.tar.gz: 5b91217eb10b3552f8c83a3890a3d2fc69e2740f0572f20f4980c9b372dd2d6e13a35575609b030947db53cd86f71a384b9d83c66adc6d04b311b5f422dbbe35
@@ -1,5 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ # May be required before minitest (the README's `-rminitest/specguard_plugin` path):
4
+ # load real minitest, never a bare stub — under discovery the require is a no-op.
5
+ require "minitest"
6
+
3
7
  # Minitest's plugin discovery point. Minitest loads every `minitest/*_plugin.rb`
4
8
  # it can find on the load path (`Minitest.load_plugins` → `Gem.find_files`), so
5
9
  # a gem providing this file needs no require in the consumer's spec files —
@@ -69,13 +69,6 @@ module SpecGuard
69
69
  end
70
70
  end
71
71
 
72
- # Internal, never on the wire: `record` stashes the result's own method
73
- # name under this key so `uniquify_ids!` can re-identify colliding rows
74
- # at delivery time, and `uniquify_ids!` strips it again before the
75
- # payload is built. The underscore prefix exists so a leak onto the
76
- # wire would be loud in any payload diff rather than plausible.
77
- RESULT_NAME_KEY = "_specguard_result_name"
78
-
79
72
  def initialize(configuration: SpecGuard::RSpec.configuration,
80
73
  transport: nil, output: $stderr,
81
74
  annotations: SpecGuard::RSpec::AnnotationLookup.new,
@@ -113,9 +106,6 @@ module SpecGuard
113
106
  row = row_for(result)
114
107
  return unless row
115
108
 
116
- # Stashed for `uniquify_ids!` (and stripped there) — the one
117
- # unique-per-result token a Minitest row has. See that method.
118
- row[RESULT_NAME_KEY] = result.name.to_s
119
109
  @rows << row
120
110
  rescue ScriptError, StandardError
121
111
  nil
@@ -153,21 +143,32 @@ module SpecGuard
153
143
  # parallel mode records from its worker threads through this one shared
154
144
  # reporter — so the collision is detectable exactly once, at delivery.
155
145
  # Every member of a colliding group is re-identified as
156
- # `"#{file}:#{line}##{method_name}"`: a method name is unique per
157
- # class and deterministic, so the suffixed ids are stable across runs.
158
- # ALL members take the suffix, never just later arrivals — parallel
146
+ # `"#{file}:#{line}##{Klass#method_name}"`, suffixed with the row's own
147
+ # class-qualified wire `name` not the bare method name, which stops
148
+ # distinguishing results the moment TWO classes share one `define_method`
149
+ # call site (Rails' declarative `test "desc"` helper is exactly that
150
+ # shape: one `define_method` inside activesupport, shared by every test
151
+ # class in the suite) and generate identically-named methods. The
152
+ # class-qualified name is unique per result and deterministic, so the
153
+ # suffixed ids are stable across runs. The token is read straight off
154
+ # the row rather than stashed at `record` time: `row["name"]` already IS
155
+ # `"#{result.klass}##{result.name}"`, so a sidecar would be a
156
+ # byte-identical copy of a value already on the wire — redundant state
157
+ # and one more thing that could leak. ALL members take the suffix,
158
+ # never just later arrivals — parallel
159
159
  # mode's arrival order is fork scheduling, so "the first row keeps the
160
160
  # bare id" would make identity depend on it. Rows whose id no other
161
161
  # row claims — every plain `def test_` suite among them — keep the id
162
- # they always had, byte for byte.
162
+ # they always had, byte for byte. The id remains the run-local primary
163
+ # key for one delivered payload and never a cross-run stable identity:
164
+ # cross-run matching remains name + file, the platform's own rule.
163
165
  def uniquify_ids!
164
166
  counts = Hash.new(0)
165
167
  @rows.each { |row| counts[row["id"]] += 1 }
166
168
  @rows.each do |row|
167
- name = row.delete(RESULT_NAME_KEY)
168
- next unless counts[row["id"]] > 1 && !name.to_s.empty?
169
+ next unless counts[row["id"]] > 1
169
170
 
170
- row["id"] = "#{row["id"]}##{name}"
171
+ row["id"] = "#{row["id"]}##{row["name"]}"
171
172
  end
172
173
  end
173
174
 
@@ -196,12 +196,21 @@ module SpecGuard
196
196
  # permits. This path reports nothing and exits 0; the backend
197
197
  # reports a parse failure and exits 1.
198
198
  #
199
- # RATIFIED, and the reason is scope rather than preference. This gem's
200
- # hand-rolled validation logic is slated for REMOVAL by the roadmap that
201
- # owns the binary, not for repair; and closing the gap here would be a
202
- # change to the DEFAULT path, which the slice that introduced
203
- # `ValidatorBackend` explicitly holds fixed. Whoever removes this parser
204
- # closes it by deletion.
199
+ # RATIFIED, and the reason is scope rather than preference.
200
+ # `specguard-lint` validates through the `validate-intent` binary and
201
+ # only the binary, so closing a gap here would be a change to the
202
+ # DEFAULT path, which the slice that introduced `ValidatorBackend`
203
+ # explicitly holds fixed.
204
+ #
205
+ # RETAINED by design, not awaiting deletion. SPGD-96 — the roadmap that
206
+ # owned the binary, and the remover this comment once pointed at —
207
+ # completed 2026-09-06, having carried out the removal it could: the
208
+ # schema-application arm, gone in `c9dca61` ({Linter}'s header records
209
+ # the survivor shape). This input half survived that cutover on purpose:
210
+ # {Scanner.scan_text} is the formatter's `ValidatorError` rescue path
211
+ # ({AnnotationLookup}) and the engine of the suite's validator stub
212
+ # (`spec/support/validator_stub.rb`), and `parse` is its per-token step —
213
+ # removing it would rewrite discovery, not delete dead code.
205
214
  #
206
215
  # Asserted from both sides — what this parser accepts, the convergence,
207
216
  # and both surviving divergences — in
@@ -7,5 +7,5 @@
7
7
  # framework-scoped version constant a lie, so the number moved here and the
8
8
  # rspec module now points at it for back-compat.
9
9
  module SpecGuard
10
- VERSION = "0.3.6"
10
+ VERSION = "0.3.8"
11
11
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: specguard-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.6
4
+ version: 0.3.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - specguard Agent
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-09-08 00:00:00.000000000 Z
11
+ date: 2026-09-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json