typhoeus 0.1.23 → 0.1.24
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/typhoeus.rb +1 -1
- data/lib/typhoeus/hydra.rb +5 -0
- data/lib/typhoeus/response.rb +8 -0
- data/spec/typhoeus/response_spec.rb +12 -0
- metadata +2 -2
data/lib/typhoeus.rb
CHANGED
data/lib/typhoeus/hydra.rb
CHANGED
data/lib/typhoeus/response.rb
CHANGED
@@ -48,4 +48,16 @@ describe Typhoeus::Response do
|
|
48
48
|
response.headers_hash["Set-Cookie"].should include("_session=BAh7CToPc2Vzc2lvbl9pZCIlZTQzMDQzMDg1YjI3MTQ4MzAzMTZmMWZmMWJjMTU1NmI6CWNhcnQiJThmZGQ2YTgyOGQ5Yzg5YTczN2E1MjY2OGJlMGNlYmFmOgZyIgA6BnMiDi9jYXJ0L2FkZA%3D%3D--6b0a699625caed9597580d8e9b6ca5f5e5954125; path=/; HttpOnly")
|
49
49
|
end
|
50
50
|
end
|
51
|
+
|
52
|
+
describe "status checking" do
|
53
|
+
it "is successful if response code is 200-299" do
|
54
|
+
Typhoeus::Response.new(:code => 220).success?.should be
|
55
|
+
Typhoeus::Response.new(:code => 400).success?.should_not be
|
56
|
+
end
|
57
|
+
|
58
|
+
it "is not modified if the status code is 304" do
|
59
|
+
Typhoeus::Response.new(:code => 304).modified?.should_not be
|
60
|
+
Typhoeus::Response.new(:code => 200).modified?.should be
|
61
|
+
end
|
62
|
+
end
|
51
63
|
end
|