class FlexMock::MinitestFrameworkAdapter
Adapter for adapting FlexMock to the Test::Unit framework.
Attributes
assertions[RW]
Public Class Methods
new()
click to toggle source
# File lib/flexmock/minitest_integration.rb, line 73 def initialize @assertions = 0 end
Public Instance Methods
assertion_failed_error()
click to toggle source
# File lib/flexmock/minitest_integration.rb, line 100 def assertion_failed_error MiniTest::Assertion end
check(msg) { || ... }
click to toggle source
# File lib/flexmock/minitest_integration.rb, line 93 def check(msg, &block) unless yield msg = msg.call if msg.is_a?(Proc) raise CheckFailedError, msg, filtered_backtrace end end
check_failed_error()
click to toggle source
# File lib/flexmock/minitest_integration.rb, line 104 def check_failed_error CheckFailedError end
filtered_backtrace()
click to toggle source
# File lib/flexmock/minitest_integration.rb, line 77 def filtered_backtrace bt = caller flexmock_dir = File.expand_path(File.dirname(__FILE__)) while bt.first.start_with?(flexmock_dir) bt.shift end bt end
make_assertion(msg, backtrace = caller) { || ... }
click to toggle source
# File lib/flexmock/minitest_integration.rb, line 86 def make_assertion(msg, backtrace = caller, &block) assert(yield, msg) rescue Exception => e e.set_backtrace backtrace raise e end