summary refs log tree commit
path: root/test/spec_showexceptions.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/spec_showexceptions.rb')
-rw-r--r--test/spec_showexceptions.rb20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/spec_showexceptions.rb b/test/spec_showexceptions.rb
index 82ac9184..908f7b73 100644
--- a/test/spec_showexceptions.rb
+++ b/test/spec_showexceptions.rb
@@ -20,4 +20,24 @@ describe Rack::ShowExceptions do
     res.should =~ /RuntimeError/
     res.should =~ /ShowExceptions/
   end
+
+  it "handles exceptions without a backtrace" do
+    res = nil
+
+    req = Rack::MockRequest.new(
+      Rack::ShowExceptions.new(
+        lambda{|env| raise RuntimeError, "", [] }
+    ))
+
+    lambda{
+      res = req.get("/")
+    }.should.not.raise
+
+    res.should.be.a.server_error
+    res.status.should.equal 500
+
+    res.should =~ /RuntimeError/
+    res.should =~ /ShowExceptions/
+    res.should =~ /unknown location/
+  end
 end