1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

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
This commit is contained in:
nobu 2013-11-09 13:35:01 +00:00
parent 00dab76f20
commit ab60cf1a99

View file

@ -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