class Webspicy::Specification::Pre::GlobalRequestHeaders

Constants

DEFAULT_OPTIONS

Attributes

headers[R]
matcher[R]

Public Class Methods

new(headers, options = {}, &bl) click to toggle source
# File lib/webspicy/specification/pre/global_request_headers.rb, line 9
def initialize(headers, options = {}, &bl)
  @headers = headers
  @options = DEFAULT_OPTIONS.merge(options)
  @matcher = bl
end

Public Instance Methods

instrument() click to toggle source
# File lib/webspicy/specification/pre/global_request_headers.rb, line 25
def instrument
  extra = headers.reject{|k|
    test_case.headers.has_key?(k)
  }
  test_case.headers.merge!(extra)
end
match(service, pre) click to toggle source
# File lib/webspicy/specification/pre/global_request_headers.rb, line 16
def match(service, pre)
  if matcher
    return self if matcher.call(service)
    nil
  else
    self
  end
end