From: Jim Weirich Date: Mon, 16 Aug 2010 20:53:56 +0000 (-0400) Subject: Added support for minitest under Ruby 1.9. X-Git-Tag: cinci-day-of-ruby-2010~20 X-Git-Url: https://git.eng.unimelb.edu.au/public?a=commitdiff_plain;h=f2ac27f52e1d259366c1cdad474cd7ffeec8e770;p=ruby_koans.git Added support for minitest under Ruby 1.9. --- diff --git a/src/edgecase.rb b/src/edgecase.rb index d0aa616..a0c782c 100644 --- a/src/edgecase.rb +++ b/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 @@ 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