Module: Riot::Gear::AssertsHeader

Defined in:
lib/riot/gear/context/asserts_header.rb

Instance Method Summary collapse

Instance Method Details

#asserts_header(header_key) ⇒ Riot::Assertion

Generates an assertion that retrieves the value of some header from the last response.

asserts_header("Content-Length").equals("125")

Parameters:

  • header_key (String)

    the name of the header

Returns:

  • (Riot::Assertion)

    an assertion block that macros can be applied to



13
14
15
# File 'lib/riot/gear/context/asserts_header.rb', line 13

def asserts_header(header_key)
  asserts("header variable #{header_key}") { response.headers[header_key] }
end