Skip to content

Commit efca0f4

Browse files
hsbtclaude
authored andcommitted
Use $LOAD_PATH.replace for safer restoration in test
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 9bcd9ba commit efca0f4

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

test/test_bundled_gems.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,12 @@ def test_no_warning_for_subfeature_found_outside_stdlib
6161
Dir.mktmpdir do |dir|
6262
FileUtils.mkdir_p(File.join(dir, "benchmark"))
6363
File.write(File.join(dir, "benchmark", "ips.rb"), "")
64+
original_load_path = $LOAD_PATH.dup
6465
$LOAD_PATH.unshift(dir)
6566
begin
6667
assert_nil Gem::BUNDLED_GEMS.warning?("benchmark/ips", specs: {})
6768
ensure
68-
$LOAD_PATH.shift
69+
$LOAD_PATH.replace(original_load_path)
6970
end
7071
end
7172
end

0 commit comments

Comments
 (0)