2008-12-11 10:40:24 +00:00
|
|
|
require 'test/unit/assertions'
|
|
|
|
|
|
|
|
module Test
|
|
|
|
module Unit
|
2009-08-06 03:05:16 +00:00
|
|
|
# remove silly TestCase class
|
|
|
|
remove_const(:TestCase) if defined?(self::TestCase)
|
|
|
|
|
2008-12-11 10:40:24 +00:00
|
|
|
class TestCase < MiniTest::Unit::TestCase
|
|
|
|
include Assertions
|
2011-02-24 01:08:51 +00:00
|
|
|
|
2011-06-16 11:24:23 +00:00
|
|
|
def on_parallel_worker?
|
|
|
|
false
|
|
|
|
end
|
|
|
|
|
2011-02-24 01:08:51 +00:00
|
|
|
def run runner
|
|
|
|
@options = runner.options
|
|
|
|
super runner
|
|
|
|
end
|
|
|
|
|
2008-12-11 10:40:24 +00:00
|
|
|
def self.test_order
|
|
|
|
:sorted
|
|
|
|
end
|
2012-07-21 05:12:32 +00:00
|
|
|
|
|
|
|
def self.method_added(name)
|
2012-07-21 06:14:24 +00:00
|
|
|
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
|
2012-07-21 05:12:32 +00:00
|
|
|
end
|
2008-12-11 10:40:24 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|