class TarkaMatchers::Matchers::Expectation::HaveADescriptionOf

Public Class Methods

new(expected) click to toggle source
# File lib/tarka_matchers/matchers/expectation/have_a_description_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_description_of.rb, line 29
def description     
        "utilize a matcher that has a description of: '#{@expected}'"
end
failure_message() click to toggle source
# File lib/tarka_matchers/matchers/expectation/have_a_description_of.rb, line 33
def failure_message
        "The matcher, '#{@actual_matcher.class}', does not have the expected description: #{TarkaMatchers::Formatters::Difference.difference(@expected,@actual)}"
end
failure_message_when_negated() click to toggle source
# File lib/tarka_matchers/matchers/expectation/have_a_description_of.rb, line 37
def failure_message_when_negated
        "#{description}"
end
matches?(actual) click to toggle source
# File lib/tarka_matchers/matchers/expectation/have_a_description_of.rb, line 21
def matches? actual
        captured = TarkaMatchers::Helpers::Expectation::ExpectCapture.capture(actual)
        @actual_matcher = captured[1]
        @actual = escape(@actual_matcher.description.prepend captured[0])
        clean!(@actual)
        @actual == @expected
end
supports_block_expectations?() click to toggle source
# File lib/tarka_matchers/matchers/expectation/have_a_description_of.rb, line 17
def supports_block_expectations?
        true
end