summaryrefslogtreecommitdiff
path: root/test/lib/test/unit/testcase.rb
diff options
context:
space:
mode:
authorhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-05-17 06:26:51 +0000
committerhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-05-17 06:26:51 +0000
commitf8c6a5dc02439bb99c8403602288c2937b9356cc (patch)
tree263e3a008f86de66e7d93f5aa4be8b708cc20020 /test/lib/test/unit/testcase.rb
parentc466dcc05bd9b95717dba424be9535e2e75822bc (diff)
* test/runner.rb: remove dependency test-unit and minitest
from stdlib when running with test-all. [Feature #9711][ruby-core:61890] * test/testunit/*.rb: ditto. * test/lib: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45970 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/lib/test/unit/testcase.rb')
-rw-r--r--test/lib/test/unit/testcase.rb34
1 files changed, 34 insertions, 0 deletions
diff --git a/test/lib/test/unit/testcase.rb b/test/lib/test/unit/testcase.rb
new file mode 100644
index 00000000000..984f08dd32c
--- /dev/null
+++ b/test/lib/test/unit/testcase.rb
@@ -0,0 +1,34 @@
+require 'test/unit/assertions'
+
+module Test
+ module Unit
+ # remove silly TestCase class
+ remove_const(:TestCase) if defined?(self::TestCase)
+
+ class TestCase < MiniTest::Unit::TestCase # :nodoc: all
+ include Assertions
+
+ def on_parallel_worker?
+ false
+ end
+
+ def run runner
+ @options = runner.options
+ super runner
+ end
+
+ def self.test_order
+ :sorted
+ end
+
+ def self.method_added(name)
+ return unless name.to_s.start_with?("test_")
+ @test_methods ||= {}
+ if @test_methods[name]
+ warn "test/unit warning: method #{ self }##{ name } is redefined"
+ end
+ @test_methods[name] = true
+ end
+ end
+ end
+end