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.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/spec_mock.rb b/test/spec_mock.rb
index a4d4e5a5..e383f203 100644
--- a/test/spec_mock.rb
+++ b/test/spec_mock.rb
@@ -211,6 +211,23 @@ describe Rack::MockRequest do
     Rack::MockRequest.new(capp).get('/', :lint => true)
     called.must_equal true
   end
+
+  it "defaults encoding to ASCII 8BIT" do
+    req = Rack::MockRequest.env_for("/foo")
+
+    keys = [
+        Rack::REQUEST_METHOD,
+        Rack::SERVER_NAME,
+        Rack::SERVER_PORT,
+        Rack::QUERY_STRING,
+        Rack::PATH_INFO,
+        Rack::HTTPS,
+        Rack::RACK_URL_SCHEME
+    ]
+    keys.each do |k|
+      assert_equal Encoding::ASCII_8BIT, req[k].encoding
+    end
+  end
 end
 
 describe Rack::MockResponse do