Class: FlexMock::TestUnitFrameworkAdapter

Inherits:
Object
  • Object
show all
Includes:
Test::Unit::Assertions
Defined in:
lib/flexmock/test_unit_integration.rb

Overview

Adapter for adapting FlexMock to the Test::Unit framework.

Instance Method Summary collapse

Instance Method Details

#assertion_failed_errorObject



58
59
60
61
62
# File 'lib/flexmock/test_unit_integration.rb', line 58

def assertion_failed_error
  defined?(Test::Unit::AssertionFailedError) ?
    Test::Unit::AssertionFailedError :
    MiniTest::Assertion
end

#make_assertion(msg, &block) ⇒ Object



48
49
50
51
52
53
54
55
56
# File 'lib/flexmock/test_unit_integration.rb', line 48

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