diff --git a/lib/zeitwerk/loader.rb b/lib/zeitwerk/loader.rb index f5e7a37b..15de02ef 100644 --- a/lib/zeitwerk/loader.rb +++ b/lib/zeitwerk/loader.rb @@ -256,9 +256,8 @@ def unregister # The return value of this predicate is only meaningful if the loader has # scanned the file. This is the case in the spots where we use it. # - # @private # @sig (String) -> Boolean - def shadowed_file?(file) + internal def shadowed_file?(file) shadowed_files.member?(file) end diff --git a/test/lib/zeitwerk/test_shadowed_files.rb b/test/lib/zeitwerk/test_shadowed_files.rb index ab3498ca..5d79fb05 100644 --- a/test/lib/zeitwerk/test_shadowed_files.rb +++ b/test/lib/zeitwerk/test_shadowed_files.rb @@ -10,7 +10,7 @@ class TestShadowedFiles < LoaderTest files = [["x.rb", "X = 2"]] with_setup(files) do - assert loader.shadowed_file?(File.expand_path("x.rb")) + assert loader.__shadowed_file?(File.expand_path("x.rb")) assert_equal 1, ::X loader.reload @@ -25,8 +25,8 @@ class TestShadowedFiles < LoaderTest loader.push_dir("b") loader.setup - assert !loader.shadowed_file?(File.expand_path("a/x.rb")) - assert loader.shadowed_file?(File.expand_path("b/x.rb")) + assert !loader.__shadowed_file?(File.expand_path("a/x.rb")) + assert loader.__shadowed_file?(File.expand_path("b/x.rb")) assert_equal 1, ::X loader.reload @@ -40,8 +40,8 @@ class TestShadowedFiles < LoaderTest first_loader = new_loader(dirs: "a") second_loader = new_loader(dirs: "b") - assert !first_loader.shadowed_file?(File.expand_path("a/x.rb")) - assert second_loader.shadowed_file?(File.expand_path("b/x.rb")) + assert !first_loader.__shadowed_file?(File.expand_path("a/x.rb")) + assert second_loader.__shadowed_file?(File.expand_path("b/x.rb")) assert_equal 1, ::X second_loader.reload