Sha256: 9cd296e8c4d465f00c99c31dc4268f9a7842a6fa0851d4ce842ae0d31d589e1a

Contents?: true

Size: 526 Bytes

Versions: 1

Compression:

Stored size: 526 Bytes

Contents

module MatchHelpers
  class MatchMatcher
    attr_reader :value, :matcher

    def initialize(value)
      @value = value
    end

    def matches?(matcher)
      @matcher = matcher
      matcher.matches?(value)
    end

    def description
      "match #{value}"
    end

    def failure_message
      "expect #{matcher} to match #{value} but did not"
    end

    def failure_message_when_negated
      "expect #{matcher} to not match #{value} but did"
    end
  end

  def match(value)
    MatchMatcher.new(value)
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
warp-1.1.0 spec/support/match_helpers.rb