From ab60cf1a99607a0f679ed4aa44ad40d6af8fab19 Mon Sep 17 00:00:00 2001 From: nobu Date: Sat, 9 Nov 2013 13:35:01 +0000 Subject: 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 --- test/objspace/test_objspace.rb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/test/objspace/test_objspace.rb b/test/objspace/test_objspace.rb index f7f507896e..0394a8a92f 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 -- cgit v1.2.3