Added support for minitest under Ruby 1.9.

This commit is contained in:
Jim Weirich
2010-08-16 16:53:56 -04:00
parent c4549eb24b
commit f2ac27f52e

View File

@@ -46,7 +46,13 @@ module EdgeCase
class Sensei
attr_reader :failure, :failed_test
AssertionError = Test::Unit::AssertionFailedError
in_ruby_version("1.8") do
AssertionError = Test::Unit::AssertionFailedError
end
in_ruby_version("1.9") do
AssertionError = MiniTest::Assertion
end
def initialize
@pass_count = 0
@@ -169,12 +175,12 @@ module EdgeCase
test.setup
begin
test.send(method)
rescue StandardError => ex
rescue StandardError, EdgeCase::Sensei::AssertionError => ex
test.failed(ex)
ensure
begin
test.teardown
rescue StandardError => ex
rescue StandardError, EdgeCase::Sensei::AssertionError => ex
test.failed(ex) if test.passed?
end
end