class MotionSpec::Matcher::EndWith

Public Class Methods

new(end_string) click to toggle source
# File lib/motion-spec/matcher/end_with.rb, line 4
def initialize(end_string)
  @end_string = end_string
end

Public Instance Methods

fail!(subject, negated) click to toggle source
# File lib/motion-spec/matcher/end_with.rb, line 12
def fail!(subject, negated)
  fail FailedExpectation.new(
    FailMessageRenderer.message_for_end_with(
      negated, subject, @end_string
    )
  )
end
matches?(subject) click to toggle source
# File lib/motion-spec/matcher/end_with.rb, line 8
def matches?(subject)
  subject[-@end_string.size..-1] == @end_string
end