Skip to content

Commit be53abb

Browse files
pftgclaude
andcommitted
fix: resolve setup ordering issue with DSLStub in Ruby 4.0
DSLStub#setup (method override) runs after ActiveSupport setup blocks, causing @manager to be overridden with the wrong root path. Switch to def setup/teardown methods so the test's manager wins via super chain. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 0929cfa commit be53abb

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

test/unit/stable_screenshoter_test.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,15 @@ module Diff
88
class StableScreenshoterTest < ActiveSupport::TestCase
99
include CapybaraScreenshotDiff::DSLStub
1010

11-
setup do
11+
def setup
12+
super
1213
@manager = CapybaraScreenshotDiff::SnapManager.new(Capybara::Screenshot.root / "stable_screenshoter_test")
1314
@manager.create_output_directory_for
1415
end
1516

16-
teardown do
17+
def teardown
1718
@manager.cleanup!
19+
super
1820
end
1921

2022
test "#take_stable_screenshot retries until images are stable across iterations" do

0 commit comments

Comments
 (0)