summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-04-11 05:13:31 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-04-11 05:13:31 +0000
commitba56de8b061b5162e3db64a4f582b628c987d5dc (patch)
tree48784abe532f2e6a0d6c356ccbd757be38731990
parentbf6a8134f8abb6c6a57cf297ab126267b43b5c24 (diff)
test_coverage.rb: suppress warnings
* test/coverage/test_coverage.rb (test_coverage_snapshot), (test_restarting_coverage): use unique names to suppress method redefinition warnings. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54535 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--test/coverage/test_coverage.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/test/coverage/test_coverage.rb b/test/coverage/test_coverage.rb
index 49b64eb..8bc1104 100644
--- a/test/coverage/test_coverage.rb
+++ b/test/coverage/test_coverage.rb
@@ -29,7 +29,7 @@ class TestCoverage < Test::Unit::TestCase
Dir.chdir(tmp) {
File.open("test.rb", "w") do |f|
f.puts <<-EOS
- def coverage_test_method
+ def TestCoverage.coverage_test_snapshot
:ok
end
EOS
@@ -38,7 +38,7 @@ class TestCoverage < Test::Unit::TestCase
Coverage.start
require tmp + '/test.rb'
cov = Coverage.peek_result[tmp + '/test.rb']
- coverage_test_method
+ TestCoverage.coverage_test_snapshot
cov2 = Coverage.peek_result[tmp + '/test.rb']
assert_equal cov[1] + 1, cov2[1]
assert_equal cov2, Coverage.result[tmp + '/test.rb']
@@ -55,7 +55,7 @@ class TestCoverage < Test::Unit::TestCase
Dir.chdir(tmp) {
File.open("test.rb", "w") do |f|
f.puts <<-EOS
- def coverage_test_method
+ def TestCoverage.coverage_test_restarting
:ok
end
EOS
@@ -63,7 +63,7 @@ class TestCoverage < Test::Unit::TestCase
File.open("test2.rb", "w") do |f|
f.puts <<-EOS
- 1 + 2
+ itself
EOS
end
@@ -75,7 +75,7 @@ class TestCoverage < Test::Unit::TestCase
# Restart coverage but '/test.rb' is required before restart,
# so coverage is not recorded.
Coverage.start
- coverage_test_method
+ TestCoverage.coverage_test_restarting
assert_equal({}, Coverage.result)
# Restart coverage and '/test2.rb' is required after restart,