Sha256: d5f30b8b3c25efd64b1d807f95b914144330b5179c83719e7cabf10dafd124d5

Contents?: true

Size: 467 Bytes

Versions: 10

Compression:

Stored size: 467 Bytes

Contents

module Boxes
  module Testing
    module Matchers
      class BaseMatcher
        attr_reader :actual, :expected

        # we can't compare to nil, because we might want nil
        UNDEFINED = Object.new.freeze

        def initialize(expected = UNDEFINED)
          @expected = expected unless UNDEFINED.equal?(expected)
        end

        def matches?(actual)
          @actual = actual
          match(actual, expected)
        end
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
boxes-3.7.0 lib/boxes/testing/matchers/base_matcher.rb
boxes-3.6.1 lib/boxes/testing/matchers/base_matcher.rb
boxes-3.6.0 lib/boxes/testing/matchers/base_matcher.rb
boxes-3.5.0 lib/boxes/testing/matchers/base_matcher.rb
boxes-3.4.0 lib/boxes/testing/matchers/base_matcher.rb
boxes-3.3.1 lib/boxes/testing/matchers/base_matcher.rb
boxes-3.3.0 lib/boxes/testing/matchers/base_matcher.rb
boxes-3.2.0 lib/boxes/testing/matchers/base_matcher.rb
boxes-3.1.0 lib/boxes/testing/matchers/base_matcher.rb
boxes-3.0.0 lib/boxes/testing/matchers/base_matcher.rb