summaryrefslogtreecommitdiff
path: root/test/objspace
diff options
context:
space:
mode:
Diffstat (limited to 'test/objspace')
-rw-r--r--test/objspace/test_objspace.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/objspace/test_objspace.rb b/test/objspace/test_objspace.rb
index 42dc55de9f..ea89a87e18 100644
--- a/test/objspace/test_objspace.rb
+++ b/test/objspace/test_objspace.rb
@@ -266,4 +266,15 @@ class TestObjSpace < Test::Unit::TestCase
File.unlink(output)
end
end
+
+ def test_dump_uninitialized_file
+ assert_in_out_err(%[-robjspace], <<-RUBY) do |output, error|
+ puts ObjectSpace.dump(File.allocate)
+ RUBY
+ assert_equal [], error
+ json = JSON.load(output.join)
+ assert_equal "FILE", json["type"]
+ assert_nil json["fd"]
+ end
+ end
end