Commit c8d2f6a
authored
fix: RSpec one-liner example descriptions (#2)
## Why?
Span names and full descriptions for RSpec one-liner syntax (like `it {
is_expected.not_to be_nil }`) were incorrectly showing file locations
instead of the matcher-generated descriptions. This made tracing output
less useful for tests using the concise one-liner syntax.
## How?
RSpec generates descriptions for one-liner examples after execution,
when the matcher runs. The formatter was capturing `description` and
`full_description` at `example_started` time, before these values were
populated.
The fix updates both the span name and `full_description` attribute in
the `example_finished` callback, after RSpec has generated the proper
description from the matcher. This ensures accurate span names and
descriptions for both one-liner and traditional examples.
We need to point Intercom's Gemfile to this repo so that we get those
updates without waiting for the upstream repo to accept them.
---
**Note:** Upstream PR created at
open-telemetry#17121 parent 536fd04 commit c8d2f6a
File tree
2 files changed
+25
-1
lines changed- instrumentation/rspec
- lib/opentelemetry/instrumentation/rspec
- test/opentelemetry/instrumentation/rspec
2 files changed
+25
-1
lines changedLines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
71 | | - | |
| 71 | + | |
| 72 | + | |
72 | 73 | | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
73 | 77 | | |
74 | 78 | | |
75 | 79 | | |
| |||
Lines changed: 20 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
326 | 326 | | |
327 | 327 | | |
328 | 328 | | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
329 | 349 | | |
330 | 350 | | |
331 | 351 | | |
| |||
0 commit comments