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

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

Overview

The Pre-Rspec 2.12 version of the matcher

Instance Method Summary collapse

Instance Method Details

#does_not_match?(given_proc) ⇒ Boolean

Returns:

  • (Boolean)


16
17
18
19
20
21
22
# File 'lib/given/rspec/have_failed_212.rb', line 16

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

#matches?(given_proc) ⇒ Boolean

Returns:

  • (Boolean)


8
9
10
11
12
13
14
# File 'lib/given/rspec/have_failed_212.rb', line 8

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

#to_sObject



24
25
26
# File 'lib/given/rspec/have_failed_212.rb', line 24

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