Class: RSpec::Http::HeaderRegexpMatcher
Instance Attribute Summary
#expected_value, #header, #response
Instance Method Summary
collapse
#matches?
Constructor Details
Returns a new instance of HeaderRegexpMatcher.
90
91
92
93
|
# File 'lib/rspec/http/header_matchers.rb', line 90
def initialize(, expected_value)
super()
@expected_value = expected_value
end
|
Instance Method Details
#description ⇒ Object
99
100
101
|
# File 'lib/rspec/http/header_matchers.rb', line 99
def description
"Verify the value associated with '#{header}' matches '#{expected_value}"
end
|
#failure_message ⇒ Object
103
104
105
|
# File 'lib/rspec/http/header_matchers.rb', line 103
def failure_message
"Expected the response header '#{header}' to have a value that matched #{expected_value.inspect} but it was '#{@response[header]}'"
end
|
#failure_message_when_negated ⇒ Object
107
108
109
|
# File 'lib/rspec/http/header_matchers.rb', line 107
def failure_message_when_negated
"Expected the response header '#{header}' to have a value that does not match #{expected_value.inspect} but it was '#{@response[header]}'"
end
|
#validate ⇒ Object
95
96
97
|
# File 'lib/rspec/http/header_matchers.rb', line 95
def validate
expected_value =~ response[]
end
|