Class: ProtobufSpec::Matchers::BeProtobufEql
- Inherits:
-
Object
- Object
- ProtobufSpec::Matchers::BeProtobufEql
- Includes:
- JsonSpec::Messages
- Defined in:
- lib/protobuf_spec/matchers/be_protobuf_eql.rb
Instance Method Summary collapse
- #actual ⇒ Object
- #at_path(path) ⇒ Object
- #description ⇒ Object
- #diffable? ⇒ Boolean
- #expected ⇒ Object
- #failure_message_for_should ⇒ Object
-
#initialize(expected_json = nil) ⇒ BeProtobufEql
constructor
A new instance of BeProtobufEql.
- #matches?(protobuf) ⇒ Boolean
- #negative_failure_message ⇒ Object
Constructor Details
#initialize(expected_json = nil) ⇒ BeProtobufEql
Returns a new instance of BeProtobufEql.
12 13 14 |
# File 'lib/protobuf_spec/matchers/be_protobuf_eql.rb', line 12 def initialize(expected_json = nil) @json_matcher= JsonSpec::Matchers::BeJsonEql.new expected_json end |
Instance Method Details
#actual ⇒ Object
20 21 22 |
# File 'lib/protobuf_spec/matchers/be_protobuf_eql.rb', line 20 def actual @json_matcher.actual end |
#at_path(path) ⇒ Object
24 25 26 27 28 |
# File 'lib/protobuf_spec/matchers/be_protobuf_eql.rb', line 24 def at_path(path) @path=path @json_matcher.at_path path self end |
#description ⇒ Object
42 43 44 |
# File 'lib/protobuf_spec/matchers/be_protobuf_eql.rb', line 42 def description ("equal Protobuf") end |
#diffable? ⇒ Boolean
8 9 10 |
# File 'lib/protobuf_spec/matchers/be_protobuf_eql.rb', line 8 def diffable? true end |
#expected ⇒ Object
16 17 18 |
# File 'lib/protobuf_spec/matchers/be_protobuf_eql.rb', line 16 def expected @json_matcher.expected end |
#failure_message_for_should ⇒ Object
34 35 36 |
# File 'lib/protobuf_spec/matchers/be_protobuf_eql.rb', line 34 def ("Expected equivalent Protobuf") end |
#matches?(protobuf) ⇒ Boolean
30 31 32 |
# File 'lib/protobuf_spec/matchers/be_protobuf_eql.rb', line 30 def matches?(protobuf) @json_matcher.matches? protobuf.to_json end |
#negative_failure_message ⇒ Object
38 39 40 |
# File 'lib/protobuf_spec/matchers/be_protobuf_eql.rb', line 38 def ("Expected inequivalent Protobuf") end |