summary refs log tree commit
path: root/test/spec_mock.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/spec_mock.rb')
-rw-r--r--test/spec_mock.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/spec_mock.rb b/test/spec_mock.rb
index a4d4e5a5..6e5555d1 100644
--- a/test/spec_mock.rb
+++ b/test/spec_mock.rb
@@ -84,6 +84,12 @@ describe Rack::MockRequest do
   it "set content length" do
     env = Rack::MockRequest.env_for("/", :input => "foo")
     env["CONTENT_LENGTH"].must_equal "3"
+
+    env = Rack::MockRequest.env_for("/", :input => StringIO.new("foo"))
+    env["CONTENT_LENGTH"].must_equal "3"
+
+    env = Rack::MockRequest.env_for("/", :input => Tempfile.new("name").tap { |t| t << "foo" })
+    env["CONTENT_LENGTH"].must_equal "3"
   end
 
   it "allow posting" do