class TarkaMatchers::Matchers::Expectation::HaveAFailureMessageWhenNegatedOf

Public Class Methods

new(expected) click to toggle source
# File lib/tarka_matchers/matchers/expectation/have_a_failure_message_when_negated_of.rb, line 13
def initialize expected
        @expected = expected
end

Public Instance Methods

description() click to toggle source
# 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() click to toggle source
# 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() click to toggle source
# 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) click to toggle source
# 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?() click to toggle source
# File lib/tarka_matchers/matchers/expectation/have_a_failure_message_when_negated_of.rb, line 17
def supports_block_expectations?
        true
end