Sha256: 8e189f814c299d75e8d64be13635d5f85cf755a635ff07f93bc422e892eb688a

Contents?: true

Size: 394 Bytes

Versions: 1

Compression:

Stored size: 394 Bytes

Contents

module Matchi
  # **Equivalence** matcher.
  class Eql < BasicObject
    def initialize(expected)
      @expected = expected
    end

    # @example Is it equivalent to 'foo'?
    #   eql = Matchi::Eql.new('foo')
    #   eql.matches? { 'foo' } # => true
    #
    # @return [Boolean] Comparison between actual and expected values.
    def matches?
      @expected.eql?(yield)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
matchi-0.0.3 lib/matchi/eql.rb