Class: Restspec::HeaderTests::MatchesTest

Inherits:
Struct
  • Object
show all
Defined in:
lib/restspec/rspec/matchers/have_header.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#expected_header_regexObject

Returns the value of attribute expected_header_regex

Returns:

  • (Object)

    the current value of expected_header_regex



42
43
44
# File 'lib/restspec/rspec/matchers/have_header.rb', line 42

def expected_header_regex
  @expected_header_regex
end

Instance Method Details

#perform(key, headers) ⇒ Object



43
44
45
# File 'lib/restspec/rspec/matchers/have_header.rb', line 43

def perform(key, headers)
  headers.fetch(key).match(expected_header_regex).present?
end