Commit 18bd171
fix: skip at_exit when framework adapter handles finalization (#183)
* fix: skip at_exit when framework adapter handles finalization
Minitest, RSpec, and Cucumber adapters call finalize_reporters! via
native hooks. The at_exit fallback in html.rb was firing as a wasted
no-op for those frameworks (hitting @Finalized guard every time).
Now only registers at_exit when no known framework is loaded.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* refactor: adopt SimpleCov's external_at_exit pattern
Framework adapters set external_at_exit = true and register native
hooks (Minitest.after_run, RSpec after(:suite), Cucumber AfterAll).
The at_exit block checks the flag and skips when a framework adapter
handles finalization.
This eliminates both the double-call problem and the LIFO ordering
problem cleanly — same pattern SimpleCov uses successfully.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* docs: add custom framework finalize_reporters! and vips install notes
- Document how to call finalize_reporters! for custom test frameworks
- Add brew/apt install commands for libvips in Requirements
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* refactor: remove external_at_exit flag, rely on @Finalized guard
The external_at_exit flag was overkill — @Finalized in #finalize already
prevents double work. Simpler: at_exit always registers, framework
adapters also register native hooks, @Finalized ensures only the first
call does work.
Also move custom framework docs from README to docs/framework-setup.md.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* refactor: remove at_exit hook entirely
Framework adapters (Minitest, RSpec, Cucumber) call finalize_reporters!
via native hooks. at_exit was unreliable due to LIFO ordering and added
complexity for a case nobody hits. Custom frameworks can call
finalize_reporters! manually (documented in docs/framework-setup.md).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent fc8dbaa commit 18bd171
3 files changed
Lines changed: 14 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
196 | 196 | | |
197 | 197 | | |
198 | 198 | | |
199 | | - | |
| 199 | + | |
200 | 200 | | |
201 | 201 | | |
202 | 202 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
77 | 87 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
129 | 129 | | |
130 | 130 | | |
131 | 131 | | |
132 | | - | |
133 | | - | |
134 | | - | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
135 | 135 | | |
136 | 136 | | |
137 | 137 | | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
0 commit comments