Class: RSpecJSONAPISerializer::Matchers::BelongToMatcher

Inherits:
Object
  • Object
show all
Defined in:
lib/rspec_jsonapi_serializer/matchers/belong_to_matcher.rb

Instance Method Summary collapse

Constructor Details

#initialize(expected) ⇒ BelongToMatcher

Returns a new instance of BelongToMatcher.



8
9
10
# File 'lib/rspec_jsonapi_serializer/matchers/belong_to_matcher.rb', line 8

def initialize(expected)
  @association_matcher = AssociationMatcher.new(expected, :belong_to, :belongs_to)
end

Instance Method Details

#descriptionObject



28
29
30
# File 'lib/rspec_jsonapi_serializer/matchers/belong_to_matcher.rb', line 28

def description
  association_matcher.description
end

#failure_messageObject



32
33
34
# File 'lib/rspec_jsonapi_serializer/matchers/belong_to_matcher.rb', line 32

def failure_message
  association_matcher.failure_message
end

#failure_message_when_negatedObject



36
37
38
# File 'lib/rspec_jsonapi_serializer/matchers/belong_to_matcher.rb', line 36

def failure_message_when_negated
  association_matcher.failure_message_when_negated
end

#id_method_name(value) ⇒ Object



16
17
18
# File 'lib/rspec_jsonapi_serializer/matchers/belong_to_matcher.rb', line 16

def id_method_name(value)
  association_matcher.id_method_name(value)
end

#matches?(serializer_instance) ⇒ Boolean

Returns:

  • (Boolean)


12
13
14
# File 'lib/rspec_jsonapi_serializer/matchers/belong_to_matcher.rb', line 12

def matches?(serializer_instance)
  association_matcher.matches?(serializer_instance)
end

#object_method_name(value) ⇒ Object



20
21
22
# File 'lib/rspec_jsonapi_serializer/matchers/belong_to_matcher.rb', line 20

def object_method_name(value)
  association_matcher.object_method_name(value)
end

#serializer(value) ⇒ Object



24
25
26
# File 'lib/rspec_jsonapi_serializer/matchers/belong_to_matcher.rb', line 24

def serializer(value)
  association_matcher.serializer(value)
end