Sha256: 54bee5c8c3adaf11db41e16ed6c1db834ef875136352bd204746e01a2ca16445

Contents?: true

Size: 1000 Bytes

Versions: 51

Compression:

Stored size: 1000 Bytes

Contents

When /^a client makes a (buggy )?request to '(.*)'$/ do |buggy, path|
  t = RightSupport::Net::HTTPClient::DEFAULT_OPTIONS[:timeout]
  o = RightSupport::Net::HTTPClient::DEFAULT_OPTIONS[:open_timeout]
  When "a client makes a #{buggy}request to '#{path}' with timeout #{t} and open_timeout #{o}"
end


When /^a client makes a (buggy )?request to '(.*)' with timeout (\d+) and open_timeout (\d+)$/ do |buggy, path, timeout, open_timeout|
  buggy = !(buggy.nil? || buggy.empty?)

  @mock_servers.should_not be_nil
  @mock_servers.size.should == 1

  timeout = timeout.to_i
  open_timeout = open_timeout.to_i
  url = @mock_servers.first.url

  @http_client = RightSupport::Net::HTTPClient.new(:timeout=>timeout, :open_timeout=>open_timeout)
  @request_t0 = Time.now
  begin
    raise ArgumentError, "Fall down go boom!" if buggy
    @http_client.get("#{url}#{path}", {:timeout => timeout, :open_timeout => open_timeout})
  rescue Exception => e
    @request_error = e
  end
  @request_t1 = Time.now
end

Version data entries

51 entries across 51 versions & 1 rubygems

Version Path
right_support-2.11.3 features/step_definitions/http_client_steps.rb
right_support-2.11.2 features/step_definitions/http_client_steps.rb
right_support-2.10.1 features/step_definitions/http_client_steps.rb
right_support-2.9.6 features/step_definitions/http_client_steps.rb
right_support-2.9.5 features/step_definitions/http_client_steps.rb
right_support-2.9.4 features/step_definitions/http_client_steps.rb
right_support-2.9.3 features/step_definitions/http_client_steps.rb
right_support-2.9.2 features/step_definitions/http_client_steps.rb
right_support-2.9.1 features/step_definitions/http_client_steps.rb
right_support-2.8.46 features/step_definitions/http_client_steps.rb
right_support-2.8.45 features/step_definitions/http_client_steps.rb
right_support-2.8.44 features/step_definitions/http_client_steps.rb
right_support-2.8.43 features/step_definitions/http_client_steps.rb
right_support-2.8.42 features/step_definitions/http_client_steps.rb
right_support-2.8.41 features/step_definitions/http_client_steps.rb
right_support-2.8.40 features/step_definitions/http_client_steps.rb
right_support-2.8.39 features/step_definitions/http_client_steps.rb
right_support-2.8.38 features/step_definitions/http_client_steps.rb
right_support-2.8.37 features/step_definitions/http_client_steps.rb
right_support-2.8.36 features/step_definitions/http_client_steps.rb