class MotionSpec::Matcher::StartWith

Public Class Methods

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

Public Instance Methods

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