rack-api 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +1 -1
- data/lib/rack/api/runner.rb +1 -1
- data/lib/rack/api/version.rb +1 -1
- data/spec/rack-api/rescue_from_spec.rb +0 -21
- metadata +1 -1
data/Gemfile.lock
CHANGED
data/lib/rack/api/runner.rb
CHANGED
@@ -265,7 +265,7 @@ module Rack
|
|
265
265
|
:version => option(:version),
|
266
266
|
:prefix => option(:prefix),
|
267
267
|
:url_options => option(:url_options),
|
268
|
-
:rescuers => option(:rescuers, :merge)
|
268
|
+
:rescuers => option(:rescuers, :merge)
|
269
269
|
})
|
270
270
|
|
271
271
|
builder = Rack::Builder.new
|
data/lib/rack/api/version.rb
CHANGED
@@ -50,27 +50,8 @@ describe Rack::API, "Rescue from exceptions" do
|
|
50
50
|
last_response.status.should == 501
|
51
51
|
end
|
52
52
|
|
53
|
-
it "rescues from exception by using inner handler" do
|
54
|
-
Rack::API.app do
|
55
|
-
rescue_from Exception
|
56
|
-
|
57
|
-
version :v1 do
|
58
|
-
rescue_from Exception do
|
59
|
-
[500, {"Content-Type" => "text/plain"}, ["inner handler"]]
|
60
|
-
end
|
61
|
-
|
62
|
-
get("/500") { raise "Oops!" }
|
63
|
-
end
|
64
|
-
end
|
65
|
-
|
66
|
-
get "/v1/500"
|
67
|
-
last_response.body.should == "inner handler"
|
68
|
-
end
|
69
|
-
|
70
53
|
it "rescues from exception in app's context" do
|
71
54
|
Rack::API.app do
|
72
|
-
rescue_from Exception
|
73
|
-
|
74
55
|
version :v1 do
|
75
56
|
rescue_from Exception do
|
76
57
|
[500, {"Content-Type" => "text/plain"}, [self.class.name]]
|
@@ -86,8 +67,6 @@ describe Rack::API, "Rescue from exceptions" do
|
|
86
67
|
|
87
68
|
it "yields the exception object" do
|
88
69
|
Rack::API.app do
|
89
|
-
rescue_from Exception
|
90
|
-
|
91
70
|
version :v1 do
|
92
71
|
rescue_from Exception do |error|
|
93
72
|
[500, {"Content-Type" => "text/plain"}, [error.message]]
|