Class: ProtobufSpec::Matchers::BeProtobufEql
- Inherits:
-
Object
- Object
- ProtobufSpec::Matchers::BeProtobufEql
- Includes:
- JsonSpec::Messages
- Defined in:
- lib/protobuf_spec/matchers/be_protobuf_eql.rb
Instance Attribute Summary collapse
-
#actual ⇒ Object
readonly
Returns the value of attribute actual.
Instance Method Summary collapse
- #at_path(path) ⇒ Object
- #description ⇒ 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
10 11 12 |
# File 'lib/protobuf_spec/matchers/be_protobuf_eql.rb', line 10 def initialize(expected_json = nil) @json_matcher= JsonSpec::Matchers::BeJsonEql.new expected_json end |
Instance Attribute Details
#actual ⇒ Object (readonly)
Returns the value of attribute actual.
8 9 10 |
# File 'lib/protobuf_spec/matchers/be_protobuf_eql.rb', line 8 def actual @actual end |
Instance Method Details
#at_path(path) ⇒ Object
14 15 16 17 18 |
# File 'lib/protobuf_spec/matchers/be_protobuf_eql.rb', line 14 def at_path(path) @path=path @json_matcher.at_path path self end |
#description ⇒ Object
32 33 34 |
# File 'lib/protobuf_spec/matchers/be_protobuf_eql.rb', line 32 def description ("equal Protobuf") end |
#failure_message_for_should ⇒ Object
24 25 26 |
# File 'lib/protobuf_spec/matchers/be_protobuf_eql.rb', line 24 def ("Expected equivalent Protobuf") end |
#matches?(protobuf) ⇒ Boolean
20 21 22 |
# File 'lib/protobuf_spec/matchers/be_protobuf_eql.rb', line 20 def matches?(protobuf) @json_matcher.matches? protobuf.to_json end |
#negative_failure_message ⇒ Object
28 29 30 |
# File 'lib/protobuf_spec/matchers/be_protobuf_eql.rb', line 28 def ("Expected inequivalent Protobuf") end |