summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_box.rb13
1 files changed, 13 insertions, 0 deletions
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