Class: RSpecApi::Matchers::Headers::Matcher

Inherits:
Response::Matcher show all
Defined in:
lib/rspec-api/matchers/headers/matcher.rb

Direct Known Subclasses

ContentType::Matcher, PageLinks::Matcher

Instance Attribute Summary

Attributes inherited from Response::Matcher

#response

Instance Method Summary collapse

Methods inherited from Response::Matcher

#failure_message_for_should, #failure_message_for_should_not

Instance Method Details

#descriptionObject



12
13
14
# File 'lib/rspec-api/matchers/headers/matcher.rb', line 12

def description
  %Q{be a non-empty Hash}
end

#matches?(response) ⇒ Boolean

Returns:

  • (Boolean)


8
9
10
# File 'lib/rspec-api/matchers/headers/matcher.rb', line 8

def matches?(response)
  super && headers.is_a?(Hash) && headers.any?
end