Class: FlexMock::RSpecFrameworkAdapter

Inherits:
Object
  • Object
show all
Defined in:
lib/flexmock/rspec.rb

Defined Under Namespace

Classes: AssertionFailedError

Instance Method Summary collapse

Instance Method Details

#assertion_failed_errorObject



35
36
37
# File 'lib/flexmock/rspec.rb', line 35

def assertion_failed_error
  SpecModule::Expectations::ExpectationNotMetError
end

#check(msg, &block) ⇒ Object



29
30
31
# File 'lib/flexmock/rspec.rb', line 29

def check(msg, &block)
  make_assertion(msg, &block)
end

#check_failed_errorObject



38
39
40
# File 'lib/flexmock/rspec.rb', line 38

def check_failed_error
  assertion_failed_error
end

#make_assertion(msg, backtrace = caller, &block) ⇒ Object



24
25
26
27
# File 'lib/flexmock/rspec.rb', line 24

def make_assertion(msg, backtrace = caller, &block)
  msg = msg.call if msg.is_a?(Proc)
  SpecModule::Expectations.fail_with(msg) unless yield
end