Commit ceaba54
test(rails): stop the uninitialized-Sentry stub leaking into cleanup
The example stubs Sentry.initialized? to false, and RSpec tears mocks down
after the suite's after hooks run. The sentry-rails hook only clears captured
events and detaches the structured logging subscribers when Sentry reports
itself initialized, so the stub made it skip both. The subscribers stayed
attached and later examples inherited log events they never emitted, failing
whenever the order put them after this one.
Scoping the stub to the call under test lets the hook see the real state.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>1 parent e96ad96 commit ceaba54
1 file changed
Lines changed: 8 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
59 | | - | |
60 | | - | |
61 | 59 | | |
62 | 60 | | |
63 | 61 | | |
64 | 62 | | |
65 | 63 | | |
66 | 64 | | |
67 | 65 | | |
68 | | - | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
69 | 74 | | |
70 | 75 | | |
71 | 76 | | |
| |||
0 commit comments