Skip to content
Browse files

Added support for minitest under Ruby 1.9.

  • Loading branch information...
1 parent c4549eb commit f2ac27f52e1d259366c1cdad474cd7ffeec8e770 @jimweirich jimweirich committed Aug 16, 2010
Showing with 9 additions and 3 deletions.
  1. +9 −3 src/edgecase.rb
View
12 src/edgecase.rb
@@ -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 @@ 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

0 comments on commit f2ac27f

Please sign in to comment.
Something went wrong with that request. Please try again.