Skip to content

Commit 3eda7fa

Browse files
pftgclaude
andcommitted
fix: register framework-native hooks for RSpec and Cucumber
- Minitest: Minitest.after_run (runs after all tests) - RSpec: RSpec.configure { |c| c.after(:suite) } (runs after suite) - Cucumber/other: at_exit fallback at_exit fires in LIFO order, so it runs BEFORE the test framework finishes when registered after it. Framework-native hooks guarantee correct ordering — reporter has data when finalize runs. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent a8eb40f commit 3eda7fa

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

  • lib/capybara_screenshot_diff/reporters

lib/capybara_screenshot_diff/reporters/html.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,8 @@ def write_report
149149

150150
if defined?(Minitest) && Minitest.respond_to?(:after_run)
151151
Minitest.after_run(&snap_diff_finalize)
152+
elsif defined?(RSpec)
153+
RSpec.configure { |c| c.after(:suite, &snap_diff_finalize) }
152154
else
153155
at_exit(&snap_diff_finalize)
154156
end

0 commit comments

Comments
 (0)