Skip to content

Commit 3500caa

Browse files
committed
TEST: relax method invocation checking for KernelRequireTest
With ruby3.3.0dev, "require" method may invoke :to_str or :to_path more than once in ruby internal. To rescue this, relax method invocation checking for KernelRequireTest. Closes #459 .
1 parent 5edf266 commit 3500caa

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

test/load_path_cache/core_ext/kernel_require_test.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ def test_uses_the_same_duck_type_as_require
1717
$LOAD_PATH.push(dir)
1818
FileUtils.touch("#{dir}/a.rb")
1919
stringish = mock
20-
stringish.expects(:to_str).returns("a").twice # bootsnap + ruby
20+
stringish.expects(:to_str).returns("a").at_least(2) # bootsnap + ruby
2121
pathish = mock
22-
pathish.expects(:to_path).returns(stringish).twice # bootsnap + ruby
22+
pathish.expects(:to_path).returns(stringish).at_least(2) # bootsnap + ruby
2323
assert pathish.respond_to?(:to_path)
2424
require(pathish)
2525
FileUtils.rm_rf(dir)

0 commit comments

Comments
 (0)