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