Class: APIMatchers::Headers::BeJSON
- Inherits:
-
Base
- Object
- Base
- APIMatchers::Headers::BeJSON
show all
- Defined in:
- lib/api_matchers/headers/be_json.rb
Instance Attribute Summary
Attributes inherited from Base
#setup
Instance Method Summary
collapse
Methods inherited from Base
#content_type_response, #initialize, #matches?
Instance Method Details
#expected_content_type ⇒ Object
4
5
6
|
# File 'lib/api_matchers/headers/be_json.rb', line 4
def expected_content_type
'application/json; charset=utf-8'
end
|
#failure_message ⇒ Object
Also known as:
failure_message_for_should
8
9
10
|
# File 'lib/api_matchers/headers/be_json.rb', line 8
def failure_message
%Q{expected a JSON response with '#{expected_content_type}'. Got: '#{content_type_response}'.}
end
|
#failure_message_when_negated ⇒ Object
Also known as:
failure_message_for_should_not
12
13
14
|
# File 'lib/api_matchers/headers/be_json.rb', line 12
def failure_message_when_negated
%Q{expected to not be a JSON response. Got: '#{expected_content_type}'.}
end
|