<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>features/supports_timeout_option.feature</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -8,6 +8,7 @@ Before do
   @host_and_port = &quot;0.0.0.0:#{port}&quot;
   @server = Mongrel::HttpServer.new(&quot;0.0.0.0&quot;, port)
   @server.run
+  @request_options = {}
 end
 
 After do</diff>
      <filename>features/steps/env.rb</filename>
    </modified>
    <modified>
      <diff>@@ -20,7 +20,7 @@ Then /it should return a response with a (\d+) response code/ do |code|
   @response_from_httparty.code.should eql(code.to_i)
 end
 
-Then /it should raise an HTTParty::RedirectionTooDeep exception/ do
+Then /it should raise (?:an|a) ([\w:]+) exception/ do |exception|
   @exception_from_httparty.should_not be_nil
-  @exception_from_httparty.class.should eql(HTTParty::RedirectionTooDeep)
+  @exception_from_httparty.class.name.should eql(exception)
 end</diff>
      <filename>features/steps/httparty_response_steps.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,7 +1,11 @@
+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(&quot;http://#{@host_and_port}#{url}&quot;)
-  rescue HTTParty::RedirectionTooDeep =&gt; e
+    @response_from_httparty = HTTParty.get(&quot;http://#{@host_and_port}#{url}&quot;, @request_options)
+  rescue HTTParty::RedirectionTooDeep, Timeout::Error =&gt; e
     @exception_from_httparty = e
   end
 end</diff>
      <filename>features/steps/httparty_steps.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
 def basic_mongrel_handler
   Class.new(Mongrel::HttpHandler) do
-    attr_writer :content_type, :response_body, :response_code
+    attr_writer :content_type, :response_body, :response_code, :preprocessor
 
     def initialize
       @content_type = &quot;text/html&quot;
@@ -10,6 +10,7 @@ def basic_mongrel_handler
     end
 
     def process(request, response)
+      instance_eval &amp;@preprocessor if @preprocessor
       reply_with(response, @response_code, @response_body)
     end
 </diff>
      <filename>features/steps/mongrel_helper.rb</filename>
    </modified>
    <modified>
      <diff>@@ -12,6 +12,11 @@ Given /that service is accessed at the path '(.*)'/ do |path|
   @server.register(path, @handler)
 end
 
+Given /^that service takes (\d+) seconds to generate a response$/ do |time|
+  preprocessor = lambda { sleep time.to_i }
+  @handler.preprocessor = preprocessor
+end
+
 Given /the response from the service has a Content-Type of '(.*)'/ do |content_type|
   @handler.content_type = content_type
 end</diff>
      <filename>features/steps/remote_service_steps.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>0cbdb7dfbf61e43d0cb7821883ee466061161034</id>
    </parent>
  </parents>
  <author>
    <name>Sandro Turriate</name>
    <email>sandro.turriate@gmail.com</email>
  </author>
  <url>http://github.com/jnunemaker/httparty/commit/3c208119e37c17b182b0695bda73863f5853e63c</url>
  <id>3c208119e37c17b182b0695bda73863f5853e63c</id>
  <committed-date>2009-09-12T19:48:07-07:00</committed-date>
  <authored-date>2009-09-12T19:32:59-07:00</authored-date>
  <message>Add cucumber feature to test timeout option</message>
  <tree>aeb833c4b070c5c38400c85a63574d5fd26f0f4c</tree>
  <committer>
    <name>Sandro Turriate</name>
    <email>sandro.turriate@gmail.com</email>
  </committer>
</commit>
