Class: RSpec::Http::HeaderStringMatcher
Instance Attribute Summary
#expected_value, #header, #response
Instance Method Summary
collapse
#matches?
Constructor Details
Returns a new instance of HeaderStringMatcher.
67
68
69
70
|
# File 'lib/rspec/http/header_matchers.rb', line 67
def initialize(, expected_value)
super()
@expected_value = expected_value
end
|
Instance Method Details
#description ⇒ Object
76
77
78
|
# File 'lib/rspec/http/header_matchers.rb', line 76
def description
"Verify that the value associated with '#{header}' is '#{expected_value}'"
end
|
#failure_message ⇒ Object
80
81
82
|
# File 'lib/rspec/http/header_matchers.rb', line 80
def failure_message
"Expected the response header '#{header}' to have a value of '#{expected_value}' but it was '#{@response[header]}'"
end
|
#failure_message_when_negated ⇒ Object
84
85
86
|
# File 'lib/rspec/http/header_matchers.rb', line 84
def failure_message_when_negated
"Expected the response header '#{header}' to have a value that is not '#{expected_value}'"
end
|
#validate ⇒ Object
72
73
74
|
# File 'lib/rspec/http/header_matchers.rb', line 72
def validate
expected_value.downcase == response[].downcase
end
|