Sha256: d00a90010291bd49c5ab3d96cd1533c317557deb6e8554759d9f3c8c5028affa

Contents?: true

Size: 773 Bytes

Versions: 1

Compression:

Stored size: 773 Bytes

Contents

require 'json_spec/messages'

module ProtobufSpec
  module Matchers
    class BeProtobufEql
      include JsonSpec::Messages

      attr_reader :actual

      def initialize(expected_json = nil)
        @json_matcher= JsonSpec::Matchers::BeJsonEql.new expected_json
      end

      def at_path(path)
        @path=path
        @json_matcher.at_path path
        self
      end

      def matches?(protobuf)
        @json_matcher.matches? protobuf.to_json
      end

      def failure_message_for_should
        message_with_path("Expected equivalent Protobuf")
      end

      def negative_failure_message
        message_with_path("Expected inequivalent Protobuf")
      end

      def description
        message_with_path("equal Protobuf")
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
protobuf_spec-0.3.1 lib/protobuf_spec/matchers/be_protobuf_eql.rb