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

* ext/coverage/coverage.c: resurrect r32071 + add GC guard for

rb_coverages. [ruby-core:37352] [Bug #4927]
  [ruby-core:36539] [Feature #4796]

* test/coverage/test_coverage.rb resurrect r32071.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32404 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nagachika 2011-07-04 15:55:06 +00:00
parent e6d42f34e2
commit ea8b916307
3 changed files with 51 additions and 9 deletions

View file

@ -15,4 +15,29 @@ class TestCoverage < Test::Unit::TestCase
assert_kind_of(Array, val)
end
end
def test_restarting_coverage
loaded_features = $".dup
Dir.mktmpdir {|tmp|
Dir.chdir(tmp) {
File.open("test.rb", "w") do |f|
f.puts <<-EOS
def coverage_test_method
:ok
end
EOS
end
Coverage.start
require tmp + '/test.rb'
Coverage.result
Coverage.start
coverage_test_method
assert_equal 1, Coverage.result.size
}
}
ensure
$".replace loaded_features
end
end