Class: TarkaMatchers::Matchers::Expectation::HaveAFailureMessageWhenNegatedOf
Constant Summary
Helpers::Expectation::Common::NEWLINE, Helpers::Expectation::Common::SGR
Instance Method Summary
collapse
#clean!
Constructor Details
Returns a new instance of HaveAFailureMessageWhenNegatedOf.
13
14
15
|
# File 'lib/tarka_matchers/matchers/expectation/have_a_failure_message_when_negated_of.rb', line 13
def initialize expected
@expected = expected
end
|
Instance Method Details
#description ⇒ Object
27
28
29
|
# File 'lib/tarka_matchers/matchers/expectation/have_a_failure_message_when_negated_of.rb', line 27
def description
"utilize a matcher that has a failure message when negated of: '#{@expected}'"
end
|
#failure_message ⇒ Object
31
32
33
|
# File 'lib/tarka_matchers/matchers/expectation/have_a_failure_message_when_negated_of.rb', line 31
def failure_message
"The matcher, '#{@actual_matcher.class}', does not have the expected failure message when negated: #{TarkaMatchers::Formatters::Difference.difference(@expected,@actual)}"
end
|
#failure_message_when_negated ⇒ Object
35
36
37
|
# File 'lib/tarka_matchers/matchers/expectation/have_a_failure_message_when_negated_of.rb', line 35
def failure_message_when_negated
"#{description}"
end
|
#matches?(actual) ⇒ Boolean
21
22
23
24
25
|
# File 'lib/tarka_matchers/matchers/expectation/have_a_failure_message_when_negated_of.rb', line 21
def matches? actual
@actual_matcher = TarkaMatchers::Helpers::Expectation::ExpectCapture.capture(actual)[1]
@actual = clean!(escape(@actual_matcher.failure_message_when_negated))
@actual == @expected
end
|
#supports_block_expectations? ⇒ Boolean
17
18
19
|
# File 'lib/tarka_matchers/matchers/expectation/have_a_failure_message_when_negated_of.rb', line 17
def supports_block_expectations?
true
end
|