Class: RSpec::Http::HeaderPresenceMatcher
- Inherits:
-
Object
- Object
- RSpec::Http::HeaderPresenceMatcher
show all
- Defined in:
- lib/rspec/http/header_matchers.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
Returns a new instance of HeaderPresenceMatcher.
40
41
42
|
# File 'lib/rspec/http/header_matchers.rb', line 40
def initialize()
@header =
end
|
Instance Attribute Details
#expected_value ⇒ Object
Returns the value of attribute expected_value.
39
40
41
|
# File 'lib/rspec/http/header_matchers.rb', line 39
def expected_value
@expected_value
end
|
Returns the value of attribute header.
39
40
41
|
# File 'lib/rspec/http/header_matchers.rb', line 39
def
@header
end
|
#response ⇒ Object
Returns the value of attribute response.
39
40
41
|
# File 'lib/rspec/http/header_matchers.rb', line 39
def response
@response
end
|
Instance Method Details
#description ⇒ Object
53
54
55
|
# File 'lib/rspec/http/header_matchers.rb', line 53
def description
"Verify the presence of '#{}' among the response headers"
end
|
#failure_message ⇒ Object
57
58
59
|
# File 'lib/rspec/http/header_matchers.rb', line 57
def failure_message
"The header '#{}' was not found"
end
|
#failure_message_when_negated ⇒ Object
61
62
63
|
# File 'lib/rspec/http/header_matchers.rb', line 61
def failure_message_when_negated
"The header '#{}' should not have been found, but it was and it has a value of '#{response[]}'"
end
|
#matches?(response) ⇒ Boolean
44
45
46
47
|
# File 'lib/rspec/http/header_matchers.rb', line 44
def matches?(response)
@response = response
validate
end
|
#validate ⇒ Object
49
50
51
|
# File 'lib/rspec/http/header_matchers.rb', line 49
def validate
response[]
end
|