summary refs log tree commit
diff options
context:
space:
mode:
authorRyan Tomayko <rtomayko@gmail.com>2009-12-22 15:19:22 -0800
committerRyan Tomayko <rtomayko@gmail.com>2009-12-22 15:19:40 -0800
commit67f7f9b4ee1907b2db0e6addc0ad65f7d53916f4 (patch)
tree49d8e8defe3d32dd81cdf5b3e7a27e7a6685fe38
parent1ffa95c55394c862798727ac8b203ecedda8842a (diff)
downloadrack-67f7f9b4ee1907b2db0e6addc0ad65f7d53916f4.tar.gz
Failing testcase for URLMap squeeze issue
-rw-r--r--test/spec_rack_urlmap.rb24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/spec_rack_urlmap.rb b/test/spec_rack_urlmap.rb
index 6c4d72ac..93ef98b7 100644
--- a/test/spec_rack_urlmap.rb
+++ b/test/spec_rack_urlmap.rb
@@ -182,4 +182,28 @@ context "Rack::URLMap" do
     res["X-PathInfo"].should.equal "/"
     res["X-ScriptName"].should.equal ""
   end
+
+  specify "should not squeeze slashes" do
+    map = Rack::URLMap.new("/" => lambda { |env|
+                             [200,
+                              { "Content-Type" => "text/plain",
+                                "X-Position" => "root",
+                                "X-PathInfo" => env["PATH_INFO"],
+                                "X-ScriptName" => env["SCRIPT_NAME"]
+                              }, [""]]},
+                           "/foo" => lambda { |env|
+                             [200,
+                              { "Content-Type" => "text/plain",
+                                "X-Position" => "foo",
+                                "X-PathInfo" => env["PATH_INFO"],
+                                "X-ScriptName" => env["SCRIPT_NAME"]
+                              }, [""]]}
+                           )
+
+    res = Rack::MockRequest.new(map).get("/http://example.org/bar")
+    res.should.be.ok
+    res["X-Position"].should.equal "root"
+    res["X-PathInfo"].should.equal "/http://example.org/bar"
+    res["X-ScriptName"].should.equal ""
+  end
 end