Sha256: b02494c9a0b411f552086b586f964666298089ad01a607d8ea277caf4277f160

Contents?: true

Size: 1.16 KB

Versions: 3

Compression:

Stored size: 1.16 KB

Contents

When /^I set my HTTParty timeout option to (\d+)$/ do |timeout|
  @request_options[:timeout] = timeout.to_i
end

When /I call HTTParty#get with '(.*)'$/ do |url|
  begin
    @response_from_httparty = HTTParty.get("http://#{@host_and_port}#{url}", @request_options)
  rescue HTTParty::RedirectionTooDeep, Timeout::Error => e
    @exception_from_httparty = e
  end
end

When /^I call HTTParty#head with '(.*)'$/ do |url|
  begin
    @response_from_httparty = HTTParty.head("http://#{@host_and_port}#{url}", @request_options)
  rescue HTTParty::RedirectionTooDeep, Timeout::Error => e
    @exception_from_httparty = e
  end
end

When /I call HTTParty#get with '(.*)' and a basic_auth hash:/ do |url, auth_table|
  h = auth_table.hashes.first
  @response_from_httparty = HTTParty.get(
    "http://#{@host_and_port}#{url}",
    :basic_auth => { :username => h["username"], :password => h["password"] }
  )
end

When /I call HTTParty#get with '(.*)' and a digest_auth hash:/ do |url, auth_table|
  h = auth_table.hashes.first
  @response_from_httparty = HTTParty.get(
    "http://#{@host_and_port}#{url}",
    :digest_auth => { :username => h["username"], :password => h["password"] }
  )
end

Version data entries

3 entries across 3 versions & 2 rubygems

Version Path
yoyle439587298-0.13.0 features/steps/httparty_steps.rb
httparty-0.13.0 features/steps/httparty_steps.rb
httparty-0.12.0 features/steps/httparty_steps.rb