specguard-ruby 0.3.7 → 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 +4 -4
- data/lib/specguard/minitest/reporter.rb +18 -17
- data/lib/specguard/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: df7e70603cb326ea7db7783c95263a418f42b2a2472c81af5013942e31e4a936
|
|
4
|
+
data.tar.gz: e586dcea9b754ec7f953c4cbf9c24f661fc410916551cca16e5cfc39a80941b9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7e5ca1fac05f5891a127a59bf052b2c7840738880a6d2f94c0aaa608cfb5f967af5aec59910c340af09c19fae22a791d12941071ba826d93a8cf04c171380e4a
|
|
7
|
+
data.tar.gz: 5b91217eb10b3552f8c83a3890a3d2fc69e2740f0572f20f4980c9b372dd2d6e13a35575609b030947db53cd86f71a384b9d83c66adc6d04b311b5f422dbbe35
|
|
@@ -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}"
|
|
157
|
-
# class
|
|
158
|
-
#
|
|
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
|
-
|
|
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
|
|
data/lib/specguard/version.rb
CHANGED
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.
|
|
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-
|
|
11
|
+
date: 2026-09-09 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: json
|