summaryrefslogtreecommitdiff
path: root/test/objspace
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-11-09 13:35:01 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-11-09 13:35:01 +0000
commitab60cf1a99607a0f679ed4aa44ad40d6af8fab19 (patch)
tree25cf7dd3de8ea6c1c044f235c6abd03c0e6a23a1 /test/objspace
parent00dab76f20f7de04c4a2a54024c8608761c8773e (diff)
test_objspace.rb: assertion for temporary file
* test/objspace/test_objspace.rb (TestObjSpace#test_dump_all): add assertion for output to temporary file. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43616 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/objspace')
-rw-r--r--test/objspace/test_objspace.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/objspace/test_objspace.rb b/test/objspace/test_objspace.rb
index f7f5078..0394a8a 100644
--- a/test/objspace/test_objspace.rb
+++ b/test/objspace/test_objspace.rb
@@ -229,5 +229,19 @@ class TestObjSpace < Test::Unit::TestCase
dump_my_heap_please
end;
+
+ assert_in_out_err(%w[-robjspace], <<-'end;') do |(output), (error)|
+ def dump_my_heap_please
+ ObjectSpace.trace_object_allocations_start
+ GC.start
+ "TEST STRING".force_encoding("UTF-8")
+ ObjectSpace.dump_all()
+ end
+
+ puts dump_my_heap_please
+ end;
+ skip if /is not supported/ =~ error
+ assert_match(entry, File.read(output))
+ end
end
end