Skip to content

Commit 09a9597

Browse files
committed
Silence warnings when eager loading autoloaded constants
Some gems print a warning when particular files are loaded, since some dependencies that they might have been expecting to be loaded are not. These warnings are not useful when Tapioca is trying to eager load these constants, and they break our tests. In particular, the `prism` gem checks for the availability of the `parser` gem and `ruby_parser` gem, and prints a warning if they are not available. This commit silences warnings around the eager load operation.
1 parent ceefbd3 commit 09a9597

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/tapioca/runtime/trackers/autoload.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,9 @@ def with_disabled_exits(&block)
4343
Kernel.define_method(:abort, NOOP_METHOD)
4444
Kernel.define_method(:exit, NOOP_METHOD)
4545

46-
block.call
46+
Tapioca.silence_warnings do
47+
block.call
48+
end
4749
ensure
4850
Kernel.define_method(:exit, original_exit)
4951
Kernel.define_method(:abort, original_abort)

0 commit comments

Comments
 (0)