ruby-changes:31537
From: nobu <ko1@a...>
Date: Sat, 9 Nov 2013 22:35:11 +0900 (JST)
Subject: [ruby-changes:31537] nobu:r43616 (trunk): test_objspace.rb: assertion for temporary file
nobu 2013-11-09 22:35:01 +0900 (Sat, 09 Nov 2013) New Revision: 43616 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=43616 Log: test_objspace.rb: assertion for temporary file * test/objspace/test_objspace.rb (TestObjSpace#test_dump_all): add assertion for output to temporary file. Modified files: trunk/test/objspace/test_objspace.rb Index: test/objspace/test_objspace.rb =================================================================== --- test/objspace/test_objspace.rb (revision 43615) +++ test/objspace/test_objspace.rb (revision 43616) @@ -229,5 +229,19 @@ class TestObjSpace < Test::Unit::TestCas https://github.com/ruby/ruby/blob/trunk/test/objspace/test_objspace.rb#L229 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 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/