spec/http_spec.rb in em-synchrony-1.0.0 vs spec/http_spec.rb in em-synchrony-1.0.1

- old
+ new

@@ -57,27 +57,27 @@ s.stop EventMachine.stop end end - + it "should terminate immediately in case of connection errors" do EventMachine.synchrony do - response = EventMachine::HttpRequest.new(CONNECTION_ERROR_URL).get + response = EventMachine::HttpRequest.new(CONNECTION_ERROR_URL, :connection_timeout => 0.1).get response.error.should_not be_nil - + EventMachine.stop end end - + it "should process inactivity timeout correctly" do EventMachine.synchrony do s = StubServer.new("HTTP/1.0 200 OK\r\nConnection: close\r\n\r\nFoo", 5) - + start = now - r = EventMachine::HttpRequest.new(URL, :inactivity_timeout => 0.5).get - (now - start.to_f).should be_within(0.2).of(0.5) - + r = EventMachine::HttpRequest.new(URL, :inactivity_timeout => 0.1).get + (now - start.to_f).should be_within(0.2).of(0.1) + s.stop EventMachine.stop end end end