summary refs log tree commit
path: root/test/spec_builder.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/spec_builder.rb')
-rw-r--r--test/spec_builder.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/spec_builder.rb b/test/spec_builder.rb
index 111d7b55..326f6b6c 100644
--- a/test/spec_builder.rb
+++ b/test/spec_builder.rb
@@ -201,6 +201,19 @@ describe Rack::Builder do
     end.must_raise(RuntimeError)
   end
 
+  it "doesn't dupe #to_app when mapping" do
+    app = builder do
+      map '/' do |outer_env|
+        run lambda { |env|  [200, {"Content-Type" => "text/plain"}, [object_id.to_s]] }
+      end
+    end
+
+    builder_app1_id = Rack::MockRequest.new(app).get("/").body.to_s
+    builder_app2_id = Rack::MockRequest.new(app).get("/").body.to_s
+
+    assert_equal builder_app2_id, builder_app1_id
+  end
+
   describe "parse_file" do
     def config_file(name)
       File.join(File.dirname(__FILE__), 'builder', name)