Skip to content

Commit

Permalink
TEST: relax method invocation checking for KernelRequireTest
Browse files Browse the repository at this point in the history
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 .
  • Loading branch information
mtasaka committed Nov 20, 2023
1 parent 5edf266 commit 3500caa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/load_path_cache/core_ext/kernel_require_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ def test_uses_the_same_duck_type_as_require
$LOAD_PATH.push(dir)
FileUtils.touch("#{dir}/a.rb")
stringish = mock
stringish.expects(:to_str).returns("a").twice # bootsnap + ruby
stringish.expects(:to_str).returns("a").at_least(2) # bootsnap + ruby
pathish = mock
pathish.expects(:to_path).returns(stringish).twice # bootsnap + ruby
pathish.expects(:to_path).returns(stringish).at_least(2) # bootsnap + ruby
assert pathish.respond_to?(:to_path)
require(pathish)
FileUtils.rm_rf(dir)
Expand Down

0 comments on commit 3500caa

Please sign in to comment.