summaryrefslogtreecommitdiff
path: root/test/testunit
diff options
context:
space:
mode:
authorsorah <sorah@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-07-21 05:12:32 +0000
committersorah <sorah@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-07-21 05:12:32 +0000
commit7773a911f5bd0b171ae0bc6c62dbf6ca58360776 (patch)
tree6b7a7fa806674cb2b0a35ba5be163e7ee8a90e32 /test/testunit
parentc4827de949c6c1a940e1d3e48421397d01b0da8a (diff)
* lib/test/unit.rb: warn when test_* method is redefined.
Patch by mame (Yusuke Endoh). [Feature #2643] [ruby-core:27790] * test/testunit/test_redefinition.rb: Test for above. * test/testunit/test4test_redefinition.rb: Ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36484 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/testunit')
-rw-r--r--test/testunit/test4test_redefinition.rb11
-rw-r--r--test/testunit/test_redefinition.rb13
2 files changed, 24 insertions, 0 deletions
diff --git a/test/testunit/test4test_redefinition.rb b/test/testunit/test4test_redefinition.rb
new file mode 100644
index 0000000..72c4cb2
--- /dev/null
+++ b/test/testunit/test4test_redefinition.rb
@@ -0,0 +1,11 @@
+require 'test/unit'
+
+class TestForTestRedefinition < Test::Unit::TestCase
+ def test_redefinition
+ skip "do nothing (1)"
+ end
+
+ def test_redefinition
+ skip "do nothing (2)"
+ end
+end
diff --git a/test/testunit/test_redefinition.rb b/test/testunit/test_redefinition.rb
new file mode 100644
index 0000000..612661e
--- /dev/null
+++ b/test/testunit/test_redefinition.rb
@@ -0,0 +1,13 @@
+require 'test/unit'
+
+class TestHideSkip < Test::Unit::TestCase
+ def test_hideskip
+ test_out, o = IO.pipe
+ spawn(*@options[:ruby], "#{File.dirname(__FILE__)}/test4test_redefinition.rb", out: File::NULL, err: o)
+ o.close
+
+ assert_match /^test\/unit warning: method TestForTestRedefinition#test_redefinition is redefined$/,
+ test_out.read
+ test_out.close
+ end
+end