Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

added specs for request time info

  • Loading branch information...
commit 64cf274e81770158115d61e2864374db83835a49 1 parent 583af4b
Tasos Laskos Zapotek authored
Showing with 30 additions and 1 deletion.
  1. +30 −1 spec/typhoeus/request_spec.rb
31 spec/typhoeus/request_spec.rb
View
@@ -25,7 +25,7 @@
it "should dump the method" do
@request.inspect.should =~ /:get/
end
-
+
it "should dump out headers" do
@request.inspect.should =~ /"Content-Type"\s*=>\s*"text\/html"/
end
@@ -213,6 +213,35 @@
good.should be_true
end
+ describe "time info" do
+ it "should have time" do
+ response = Typhoeus::Request.get("http://localhost:3000")
+ response.time.should > 0
+ end
+
+ it "should have connect time" do
+ response = Typhoeus::Request.get("http://localhost:3000")
+ response.connect_time.should > 0
+ end
+
+ it "should have app connect time" do
+ response = Typhoeus::Request.get("http://localhost:3000")
+ response.app_connect_time.should > 0
+ end
+
+ it "should have start transfer time" do
+ response = Typhoeus::Request.get("http://localhost:3000")
+ response.start_transfer_time.should > 0
+ end
+
+ it "should have pre-transfer time" do
+ response = Typhoeus::Request.get("http://localhost:3000")
+ response.pretransfer_time.should > 0
+ end
+
+ end
+
+
describe "authentication" do
it "should allow to set username and password" do
Please sign in to comment.
Something went wrong with that request. Please try again.