Skip to content

Commit

Permalink
Added support for minitest under Ruby 1.9.
Browse files Browse the repository at this point in the history
  • Loading branch information
jimweirich committed Aug 16, 2010
1 parent c4549eb commit f2ac27f
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/edgecase.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -169,12 +175,12 @@ def run_test(method, accumulator)
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
Expand Down

0 comments on commit f2ac27f

Please sign in to comment.