summary refs log tree commit
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2011-01-13 14:27:00 -0800
committerJoshua Peek <josh@joshpeek.com>2011-01-13 18:19:44 -0600
commit4d95f605050259d96ad4ccfe9bee0ce7958643b8 (patch)
tree674ccfe4823d571a30b7aacb2ad715618837a630
parentcbcae3a2b64283785cbfddc65bc79f5c86458a4f (diff)
downloadrack-4d95f605050259d96ad4ccfe9bee0ce7958643b8.tar.gz
moving MockResponse underneath Rack::Response
Signed-off-by: Joshua Peek <josh@joshpeek.com>
-rw-r--r--lib/rack/mock.rb8
-rw-r--r--lib/rack/response.rb1
2 files changed, 4 insertions, 5 deletions
diff --git a/lib/rack/mock.rb b/lib/rack/mock.rb
index ca1a6f4e..77ef3234 100644
--- a/lib/rack/mock.rb
+++ b/lib/rack/mock.rb
@@ -141,7 +141,7 @@ module Rack
   # Usually, you don't create the MockResponse on your own, but use
   # MockRequest.
 
-  class MockResponse
+  class MockResponse < Rack::Response
     def initialize(status, headers, body, errors=StringIO.new(""))
       @status = status.to_i
 
@@ -177,11 +177,11 @@ module Rack
       @body.match other
     end
 
-
     # Errors
     attr_accessor :errors
 
-
-    include Response::Helpers
+    def empty?
+      [201, 204, 304].include? status
+    end
   end
 end
diff --git a/lib/rack/response.rb b/lib/rack/response.rb
index 32656d62..afb44ad7 100644
--- a/lib/rack/response.rb
+++ b/lib/rack/response.rb
@@ -123,7 +123,6 @@ module Rack
       def not_found?;     @status == 404;                        end
 
       def redirect?;      [301, 302, 303, 307].include? @status; end
-      def empty?;         [201, 204, 304].include?      @status; end
 
       # Headers
       attr_reader :headers, :original_headers