From 07e85e1dba3e15c714044660f731a90ce86c8c24 Mon Sep 17 00:00:00 2001 From: Satoshi Tagomori Date: Tue, 2 Dec 2025 22:22:01 +0900 Subject: Box: add a test case about deleting .so/.dll files --- test/ruby/test_box.rb | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'test/ruby') diff --git a/test/ruby/test_box.rb b/test/ruby/test_box.rb index 2e4e07a86a..1daf5d57d5 100644 --- a/test/ruby/test_box.rb +++ b/test/ruby/test_box.rb @@ -823,4 +823,17 @@ class TestBox < Test::Unit::TestCase assert_equal 42, b.eval('1+2') end; end + + def test_loaded_extension_deleted_in_user_box + require 'tmpdir' + Dir.mktmpdir do |tmpdir| + env = ENV_ENABLE_BOX.merge({'TMPDIR'=>tmpdir}) + assert_separately([env], __FILE__, __LINE__, "#{<<~"begin;"}\n#{<<~'end;'}", ignore_stderr: true) + begin; + require "json" + tmpdirname = ENV['TMPDIR'] + assert_empty(Dir.children(tmpdirname)) + end; + end + end end -- cgit v1.2.3