Sha256: d6cae7072e29548d8aa9bfe252737d08eafce5ea8167c0f8d63813bc34126d56

Contents?: true

Size: 353 Bytes

Versions: 3

Compression:

Stored size: 353 Bytes

Contents

module BaconExpect; module Matcher
  class StartWith
    def initialize(start_string)
      @start_string = start_string
    end

    def matches?(subject)
      subject[0...@start_string.size] == @start_string
    end

    def fail!(subject)
      raise FailedExpectation.new("#{subject} expected to start with #{@start_string}")
    end
  end
end; end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
bacon-expect-1.0.2 lib/bacon-expect/matchers/start_with.rb
bacon-expect-1.0.1 lib/bacon-expect/matchers/start_with.rb
bacon-expect-0.1 lib/bacon-expect/matchers/start_with.rb