class FlexMock::TestUnitFrameworkAdapter
Adapter for adapting FlexMock to the Test::Unit framework.
Attributes
assertions[RW]
Public Class Methods
new()
click to toggle source
# File lib/flexmock/test_unit_integration.rb, line 50 def initialize @assertions = 0 end
Public Instance Methods
assertion_failed_error()
click to toggle source
# File lib/flexmock/test_unit_integration.rb, line 68 def assertion_failed_error defined?(Test::Unit::AssertionFailedError) ? Test::Unit::AssertionFailedError : MiniTest::Assertion end
check(msg, &block)
click to toggle source
# File lib/flexmock/test_unit_integration.rb, line 64 def check(msg, &block) make_assertion(msg, &block) end
check_failed_error()
click to toggle source
# File lib/flexmock/test_unit_integration.rb, line 74 def check_failed_error assertion_failed_error end
make_assertion(msg) { || ... }
click to toggle source
# File lib/flexmock/test_unit_integration.rb, line 54 def make_assertion(msg, &block) unless yield msg = msg.call if msg.is_a?(Proc) assert(false, msg) end rescue assertion_failed_error => ex ex.message.sub!(/Expected block to return true value./,'') raise ex end