exceptional 2.0.9 → 2.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/exceptional.rb +3 -1
- data/lib/exceptional/version.rb +1 -1
- data/spec/exceptional_rescue_spec.rb +11 -1
- metadata +2 -2
data/lib/exceptional.rb
CHANGED
@@ -34,6 +34,7 @@ module Exceptional
|
|
34
34
|
block.call
|
35
35
|
rescue Exception => e
|
36
36
|
Exceptional::Catcher.handle(e,name)
|
37
|
+
ensure
|
37
38
|
self.clear!
|
38
39
|
end
|
39
40
|
end
|
@@ -44,8 +45,9 @@ module Exceptional
|
|
44
45
|
block.call
|
45
46
|
rescue Exception => e
|
46
47
|
Exceptional::Catcher.handle(e,name)
|
47
|
-
self.clear!
|
48
48
|
raise(e)
|
49
|
+
ensure
|
50
|
+
self.clear!
|
49
51
|
end
|
50
52
|
end
|
51
53
|
|
data/lib/exceptional/version.rb
CHANGED
@@ -59,6 +59,16 @@ context 'resuce errors from within a block' do
|
|
59
59
|
|
60
60
|
it "allows optional second paramater hash to get added to context" do
|
61
61
|
Exceptional.should_receive(:context).with(context_hash = {'foo' => 'bar', 'baz' => 42})
|
62
|
-
Exceptional.rescue('my
|
62
|
+
Exceptional.rescue('my rescue', context_hash) {}
|
63
|
+
end
|
64
|
+
|
65
|
+
it "should clear context after every invocation" do
|
66
|
+
Thread.current[:exceptional_context].should == nil
|
67
|
+
|
68
|
+
Exceptional.rescue('my rescue', context_hash = {'foo' => 'bar', 'baz' => 42}) {
|
69
|
+
Thread.current[:exceptional_context].should_not == nil
|
70
|
+
}
|
71
|
+
|
72
|
+
Thread.current[:exceptional_context].should == nil
|
63
73
|
end
|
64
74
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: exceptional
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Contrast
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2010-02-
|
12
|
+
date: 2010-02-17 00:00:00 +00:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|