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