summaryrefslogtreecommitdiff
path: root/test/coverage/test_coverage.rb
diff options
context:
space:
mode:
authoryui-knk <yui-knk@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-12-12 13:19:40 +0000
committeryui-knk <yui-knk@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-12-12 13:19:40 +0000
commitbf2321412a7bae5277aefc9d5c3a7a8be84a77d4 (patch)
treeb50f3efec15a1f4ae157c050db465bff2da949d0 /test/coverage/test_coverage.rb
parent1711b54b7bd54986b85b3577549b512303c51413 (diff)
ext/coverage/coverage.c: Add test cases
* ext/coverage/coverage.c (test_method_coverage_for_define_method): Add test cases for method coverages which test do-end block define_method. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61165 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/coverage/test_coverage.rb')
-rw-r--r--test/coverage/test_coverage.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/coverage/test_coverage.rb b/test/coverage/test_coverage.rb
index 01bacd9..3fbd815 100644
--- a/test/coverage/test_coverage.rb
+++ b/test/coverage/test_coverage.rb
@@ -359,6 +359,8 @@ class TestCoverage < Test::Unit::TestCase
def test_method_coverage_for_define_method
result = {
:methods => {
+ [Object, :a, 6, 18, 6, 25] => 2,
+ [Object, :b, 7, 18, 8, 3] => 0,
[Object, :bar, 2, 20, 3, 1] => 1,
[Object, :baz, 4, 9, 4, 11] => 0,
[Object, :foo, 1, 20, 1, 22] => 2,
@@ -370,10 +372,15 @@ class TestCoverage < Test::Unit::TestCase
}
f = proc {}
define_method(:baz, &f)
+ define_method(:a) do; end
+ define_method(:b) do
+ end
foo
foo
bar
+ a
+ a
end;
end