flail 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +3 -1
- data/lib/flail/rack.rb +1 -1
- data/lib/flail/version.rb +1 -1
- data/spec/rack_spec.rb +35 -0
- metadata +4 -2
data/Gemfile.lock
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
flail (0.1.
|
4
|
+
flail (0.1.5)
|
5
|
+
json
|
5
6
|
|
6
7
|
GEM
|
7
8
|
remote: http://rubygems.org/
|
@@ -14,6 +15,7 @@ GEM
|
|
14
15
|
activesupport (2.3.14)
|
15
16
|
diff-lcs (1.1.3)
|
16
17
|
fakeweb (1.3.0)
|
18
|
+
json (1.7.5)
|
17
19
|
rack (1.1.3)
|
18
20
|
rake (0.9.2.2)
|
19
21
|
rr (1.0.4)
|
data/lib/flail/rack.rb
CHANGED
data/lib/flail/version.rb
CHANGED
data/spec/rack_spec.rb
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
require 'ostruct'
|
4
|
+
require 'flail/rack'
|
5
|
+
|
6
|
+
describe Flail::Rack do
|
7
|
+
|
8
|
+
subject { Flail::Rack.new lambda {|env| "val: #{env.fetch(:required_key)}" } }
|
9
|
+
|
10
|
+
context "when an exception is raised by the app" do
|
11
|
+
let(:env) { {} }
|
12
|
+
|
13
|
+
it "should make an instance of Flail::Exception from the exception" do
|
14
|
+
stub_fe = OpenStruct.new(:"handle!" => nil)
|
15
|
+
mock(Flail::Exception).new(env, is_a(KeyError)) { stub_fe }
|
16
|
+
|
17
|
+
# catch the re-raised KeyError so the spec isn't wrecked
|
18
|
+
begin
|
19
|
+
subject.call(env)
|
20
|
+
rescue KeyError
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
it "should handle the new Flail::Exception" do
|
25
|
+
stub.proxy(Flail::Exception).new do |fe|
|
26
|
+
mock(fe).handle!
|
27
|
+
end
|
28
|
+
|
29
|
+
begin
|
30
|
+
subject.call(env)
|
31
|
+
rescue KeyError
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: flail
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-09-
|
12
|
+
date: 2012-09-19 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: json
|
@@ -188,6 +188,7 @@ files:
|
|
188
188
|
- spec/backtrace_spec.rb
|
189
189
|
- spec/base_spec.rb
|
190
190
|
- spec/exception_spec.rb
|
191
|
+
- spec/rack_spec.rb
|
191
192
|
- spec/rescue_action_spec.rb
|
192
193
|
- spec/spec_helper.rb
|
193
194
|
- spec/support/rr.rb
|
@@ -219,6 +220,7 @@ test_files:
|
|
219
220
|
- spec/backtrace_spec.rb
|
220
221
|
- spec/base_spec.rb
|
221
222
|
- spec/exception_spec.rb
|
223
|
+
- spec/rack_spec.rb
|
222
224
|
- spec/rescue_action_spec.rb
|
223
225
|
- spec/spec_helper.rb
|
224
226
|
- spec/support/rr.rb
|