Class: RSpec::Expectations::PositiveExpectationHandler

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

Instance Method Summary collapse

Instance Method Details

#handle_matcher_with_reporting(actual, matcher, message = nil, &block) ⇒ Object Also known as: handle_matcher



22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/interactive_rspec/monkey/rspec.rb', line 22

def handle_matcher_with_reporting(actual, matcher, message=nil, &block)
  return handle_matcher_without_reporting actual, matcher, message, &block unless InteractiveRspec.rspec_mode

  begin
    result = handle_matcher_without_reporting actual, matcher, message, &block
    if result.class == TrueClass
      InteractiveRspec.report result
    else
      result
    end
  rescue RSpec::Expectations::ExpectationNotMetError => err
    InteractiveRspec.report err
    false
  end
end