class BaconExpect::Matcher::StartWith

Public Class Methods

new(start_string) click to toggle source
# File lib/bacon-expect/matchers/start_with.rb, line 3
def initialize(start_string)
  @start_string = start_string
end

Public Instance Methods

fail!(subject, negated) click to toggle source
# File lib/bacon-expect/matchers/start_with.rb, line 11
def fail!(subject, negated)
  raise FailedExpectation.new(FailMessageRenderer.message_for_start_with(negated, subject, @start_string))
end
matches?(subject) click to toggle source
# File lib/bacon-expect/matchers/start_with.rb, line 7
def matches?(subject)
  subject[0...@start_string.size] == @start_string
end