spec/httpi/response_spec.rb in httpi-0.7.9 vs spec/httpi/response_spec.rb in httpi-0.8.0

- old
+ new

@@ -77,9 +77,15 @@ describe "#body" do it "should return the (gzip decoded) HTTP response body" do response.body.should == Fixture.xml end + + it "should bubble Zlib errors" do + arbitrary_error = Class.new(ArgumentError) + Zlib::GzipReader.expects(:new).raises(arbitrary_error) + lambda { response.body }.should raise_error(arbitrary_error) + end end describe "#raw_body" do it "should return the raw HTML response body" do response.raw_body.should == Fixture.gzip