<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -5,8 +5,7 @@ module Net
   class HTTPSuccess
 
     def body
-      case self['content-encoding']
-      when 'gzip'
+      if self['content-encoding'] == 'gzip'
         body = StringIO.new(super)
         uncompressed_body = Zlib::GzipReader.new(body)
         uncompressed_body.read</diff>
      <filename>lib/extensions/http_success.rb</filename>
    </modified>
    <modified>
      <diff>@@ -2,22 +2,29 @@ require File.join(File.dirname(__FILE__), &quot;/spec_helper&quot;)
 
 describe &quot;HTTPSuccess&quot; do
   describe &quot;.body&quot; do
-    it &quot;returns a plain text body if no compression is used in the response&quot; do
-      uri = URI.parse(&quot;http://www.example.com&quot;)
-      FakeWeb.register_uri(:any, uri, :body =&gt; &quot;#{File.dirname(__FILE__)}/support/fakeweb/www.example.com&quot;)
-
-      request = Net::HTTP::Get.new(uri.request_uri)
-      response = Net::HTTP.new(uri.host).request(request)
+    def do_request
+      request = Net::HTTP::Get.new(@uri.request_uri)
+      response = Net::HTTP.new(@uri.host).request(request)
       response.body.should match(/These domain names are reserved for use in documentation/)
     end
 
-    it &quot;returns a plain text body if gzip is used in the response&quot; do
-      uri = URI.parse(&quot;http://www.example.com&quot;)
-      FakeWeb.register_uri(:any, uri, :body =&gt; &quot;#{File.dirname(__FILE__)}/support/fakeweb/www.example.com.gz&quot;, 'content-encoding' =&gt; 'gzip')
+    before do
+      @uri = URI.parse(&quot;http://www.example.com&quot;)
+    end
 
-      request = Net::HTTP::Get.new(uri.request_uri)
-      response = Net::HTTP.new(uri.host).request(request)
-      response.body.should match(/These domain names are reserved for use in documentation/)
+    it &quot;returns a plain text body if no compression is used in the response&quot; do
+      options = { :body =&gt; &quot;#{File.dirname(__FILE__)}/support/fakeweb/www.example.com&quot; }
+      FakeWeb.register_uri(:any, @uri, options)
+      do_request
+    end
+
+    it &quot;returns a plain text body if gzip is used in the response&quot; do
+      options = { 
+        :body =&gt; &quot;#{File.dirname(__FILE__)}/support/fakeweb/www.example.com.gz&quot;, 
+        'Content-Encoding' =&gt; :gzip
+      }
+      FakeWeb.register_uri(:any, @uri, options)
+      do_request
     end
   end
 end
\ No newline at end of file</diff>
      <filename>spec/compression_spec.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>715c7f19fa572289021a661ddc97db765f1adb32</id>
    </parent>
  </parents>
  <author>
    <name>John Pignata</name>
    <email>john.pignata@gmail.com</email>
  </author>
  <url>http://github.com/jpignata/bossman-gem/commit/d9c70531e085dba6ea229e50260564ab0f866731</url>
  <id>d9c70531e085dba6ea229e50260564ab0f866731</id>
  <committed-date>2009-11-01T13:40:27-08:00</committed-date>
  <authored-date>2009-11-01T13:40:27-08:00</authored-date>
  <message>DRY'ing compression spec

Minor refactoring of HTTPResponse extension</message>
  <tree>952c101073f29f1bd1c2c0c7ee0d881e2734b14e</tree>
  <committer>
    <name>John Pignata</name>
    <email>john.pignata@gmail.com</email>
  </committer>
</commit>
