Class: ProtobufSpec::Matchers::HaveProtobufPath
- Inherits:
-
Object
- Object
- ProtobufSpec::Matchers::HaveProtobufPath
- Defined in:
- lib/protobuf_spec/matchers/have_protobuf_path.rb
Instance Attribute Summary collapse
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
- #description ⇒ Object
- #failure_message_for_should ⇒ Object
- #failure_message_for_should_not ⇒ Object
-
#initialize(path) ⇒ HaveProtobufPath
constructor
A new instance of HaveProtobufPath.
- #matches?(proto) ⇒ Boolean
Constructor Details
#initialize(path) ⇒ HaveProtobufPath
5 6 7 8 |
# File 'lib/protobuf_spec/matchers/have_protobuf_path.rb', line 5 def initialize path @path = path @json_matcher = JsonSpec::Matchers::HaveJsonPath.new path end |
Instance Attribute Details
#path ⇒ Object (readonly)
Returns the value of attribute path.
4 5 6 |
# File 'lib/protobuf_spec/matchers/have_protobuf_path.rb', line 4 def path @path end |
Instance Method Details
#description ⇒ Object
22 23 24 |
# File 'lib/protobuf_spec/matchers/have_protobuf_path.rb', line 22 def description %(have Protobuf path "#{@path}") end |
#failure_message_for_should ⇒ Object
14 15 16 |
# File 'lib/protobuf_spec/matchers/have_protobuf_path.rb', line 14 def %(Expected Protobuf path "#{@path}") end |
#failure_message_for_should_not ⇒ Object
18 19 20 |
# File 'lib/protobuf_spec/matchers/have_protobuf_path.rb', line 18 def %(Expected no Protobuf path "#{@path}") end |
#matches?(proto) ⇒ Boolean
10 11 12 |
# File 'lib/protobuf_spec/matchers/have_protobuf_path.rb', line 10 def matches? proto @json_matcher.matches? proto.to_json end |