Class: RSpecJSONAPISerializer::Matchers::HaveMetaMatchers::AsMatcher
- Inherits:
-
Base
- Object
- Base
- RSpecJSONAPISerializer::Matchers::HaveMetaMatchers::AsMatcher
show all
- Defined in:
- lib/rspec_jsonapi_serializer/matchers/have_meta_matchers/as_matcher.rb
Instance Method Summary
collapse
Methods inherited from Base
#failure_message, #failure_message_when_negated
Constructor Details
#initialize(meta, expected) ⇒ AsMatcher
Returns a new instance of AsMatcher.
9
10
11
12
13
|
# File 'lib/rspec_jsonapi_serializer/matchers/have_meta_matchers/as_matcher.rb', line 9
def initialize(meta, expected)
super(expected)
@meta = meta
end
|
Instance Method Details
#description ⇒ Object
21
22
23
|
# File 'lib/rspec_jsonapi_serializer/matchers/have_meta_matchers/as_matcher.rb', line 21
def description
"as #{expected_to_string}"
end
|
#expectation ⇒ Object
25
26
27
|
# File 'lib/rspec_jsonapi_serializer/matchers/have_meta_matchers/as_matcher.rb', line 25
def expectation
[ "as #{expected_to_string}", actual_message ].compact.join(", ")
end
|
#matches?(serializer_instance) ⇒ Boolean
15
16
17
18
19
|
# File 'lib/rspec_jsonapi_serializer/matchers/have_meta_matchers/as_matcher.rb', line 15
def matches?(serializer_instance)
@serializer_instance = serializer_instance
actual == expected
end
|