fibre 0.9.1 → 0.9.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/fibre.rb +1 -0
- data/lib/fibre/fiber_pool.rb +2 -2
- data/lib/fibre/scope.rb +0 -9
- data/lib/fibre/version.rb +1 -1
- data/spec/fibre_spec.rb +26 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c37099c6452b91dc3627b24656c72991eed7a13c
|
4
|
+
data.tar.gz: 03e7c7000a4e00d218775bb50b326db2481ecb75
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dc7f63ee5160019a317e812f58faa58c0958b6f1c6bf8e6bc60e91e10e3be41b5349967f5e22d6279c95c1d14802771fc493e33a00423dcece6b4fb24fdf083b
|
7
|
+
data.tar.gz: 3aecdcd1a4d95aaf0532a972772a5a37c24a7fae801e0e8fb460b078f6841288d4a67d1a7504d0607e0db38ccf8d4d554cfb2002ccf1e943e6d1a5a4ad84170a
|
data/lib/fibre.rb
CHANGED
data/lib/fibre/fiber_pool.rb
CHANGED
data/lib/fibre/scope.rb
CHANGED
data/lib/fibre/version.rb
CHANGED
data/spec/fibre_spec.rb
CHANGED
@@ -3,6 +3,8 @@ require "spec_helper"
|
|
3
3
|
describe Fibre do
|
4
4
|
using EventObject
|
5
5
|
|
6
|
+
before { Fibre.pool = nil }
|
7
|
+
|
6
8
|
it "should create default pool with default size" do
|
7
9
|
expect(Fibre.pool.size).to be(20)
|
8
10
|
end
|
@@ -21,7 +23,10 @@ describe Fibre do
|
|
21
23
|
|
22
24
|
it "should rescue error in fiber" do
|
23
25
|
expect(probe).to receive(:call)
|
24
|
-
Fibre.pool.on(:error
|
26
|
+
Fibre.pool.on(:error) do |error|
|
27
|
+
probe.call
|
28
|
+
end
|
29
|
+
|
25
30
|
Fibre.pool.checkout do
|
26
31
|
raise
|
27
32
|
end
|
@@ -35,4 +40,24 @@ describe Fibre do
|
|
35
40
|
end
|
36
41
|
end
|
37
42
|
end
|
43
|
+
|
44
|
+
it "should raise uncatched exceptions" do
|
45
|
+
expect {
|
46
|
+
Fibre.pool.checkout do
|
47
|
+
raise
|
48
|
+
end
|
49
|
+
}.to raise_error
|
50
|
+
end
|
51
|
+
|
52
|
+
it "should catch exception" do
|
53
|
+
Fibre.pool.on :error do |error|
|
54
|
+
# catch exception here
|
55
|
+
end
|
56
|
+
|
57
|
+
expect {
|
58
|
+
Fibre.pool.checkout do
|
59
|
+
raise
|
60
|
+
end
|
61
|
+
}.to_not raise_error
|
62
|
+
end
|
38
63
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fibre
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- che
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-09-
|
11
|
+
date: 2014-09-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|