Class: RSpec::Given::HaveFailed::HaveFailedMatcher

Inherits:
Matchers::BuiltIn::RaiseError
  • Object
show all
Defined in:
lib/rspec/given/have_failed.rb,
lib/rspec/given/have_failed.rb

Instance Method Summary collapse

Instance Method Details

#does_not_match?(given_proc) ⇒ Boolean

Returns:

  • (Boolean)


22
23
24
25
26
27
28
# File 'lib/rspec/given/have_failed.rb', line 22

def does_not_match?(given_proc)
  if given_proc.is_a?(Failure)
    super(given_proc)
  else
    super(lambda { })
  end
end

#matches?(given_proc) ⇒ Boolean

Returns:

  • (Boolean)


14
15
16
17
18
19
20
# File 'lib/rspec/given/have_failed.rb', line 14

def matches?(given_proc, negative_expectation = false)
  if given_proc.is_a?(Failure)
    super
  else
    super(lambda { }, negative_expectation)
  end
end

#to_sObject



30
31
32
# File 'lib/rspec/given/have_failed.rb', line 30

def to_s
  "<Failure matching #{@expected_error}: #{@expected_message.inspect}>"
end