diff options
Diffstat (limited to 'test/objspace/test_objspace.rb')
-rw-r--r-- | test/objspace/test_objspace.rb | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/test/objspace/test_objspace.rb b/test/objspace/test_objspace.rb index d141fa9161..832c8d7f8e 100644 --- a/test/objspace/test_objspace.rb +++ b/test/objspace/test_objspace.rb @@ -308,9 +308,16 @@ class TestObjSpace < Test::Unit::TestCase end if defined?(JSON) - assert_ruby_status(%w[-rjson -robjspace], "#{<<-"begin;"}\n#{<<-"end;"}") + args = [ + "-rjson", "-", + EnvUtil.rubybin, + "--disable=gems", "-robjspace", "-eObjectSpace.dump_all(output: :stdout)", + ] + assert_ruby_status(args, "#{<<~"begin;"}\n#{<<~"end;"}") begin; - JSON.parse(ObjectSpace.dump_all(output: :string)) + IO.popen(ARGV) do |f| + JSON.load(f) + end end; end end |