[前][次][番号順一覧][スレッド一覧]

ruby-changes:42461

From: nobu <ko1@a...>
Date: Mon, 11 Apr 2016 13:16:54 +0900 (JST)
Subject: [ruby-changes:42461] nobu:r54535 (trunk): test_coverage.rb: suppress warnings

nobu	2016-04-11 14:13:31 +0900 (Mon, 11 Apr 2016)

  New Revision: 54535

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=54535

  Log:
    test_coverage.rb: suppress warnings
    
    * test/coverage/test_coverage.rb (test_coverage_snapshot),
      (test_restarting_coverage): use unique names to suppress method
      redefinition warnings.

  Modified files:
    trunk/test/coverage/test_coverage.rb
Index: test/coverage/test_coverage.rb
===================================================================
--- test/coverage/test_coverage.rb	(revision 54534)
+++ test/coverage/test_coverage.rb	(revision 54535)
@@ -29,7 +29,7 @@ class TestCoverage < Test::Unit::TestCas https://github.com/ruby/ruby/blob/trunk/test/coverage/test_coverage.rb#L29
       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::TestCas https://github.com/ruby/ruby/blob/trunk/test/coverage/test_coverage.rb#L38
         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::TestCas https://github.com/ruby/ruby/blob/trunk/test/coverage/test_coverage.rb#L55
       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::TestCas https://github.com/ruby/ruby/blob/trunk/test/coverage/test_coverage.rb#L63
 
         File.open("test2.rb", "w") do |f|
           f.puts <<-EOS
-            1 + 2
+            itself
           EOS
         end
 
@@ -75,7 +75,7 @@ class TestCoverage < Test::Unit::TestCas https://github.com/ruby/ruby/blob/trunk/test/coverage/test_coverage.rb#L75
         # 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,

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]