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