celluloid 0.0.3 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,34 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe Celluloid::Waker do
4
- it "blocks until awoken" do
5
- waker = Celluloid::Waker.new
6
- thread = Thread.new do
7
- waker.wait
8
- :done
9
- end
10
-
11
- # Assert that the thread can't be joined at this point
12
- thread.join(0).should be_nil
13
-
14
- waker.signal
15
- thread.value.should == :done
16
- end
17
-
18
- it "returns an IO object that can be multiplexed with IO.select" do
19
- waker = Celluloid::Waker.new
20
- waker.io.should be_an_instance_of(IO)
21
-
22
- thread = Thread.new do
23
- readable, _, _ = select [waker.io]
24
- waker.wait
25
- :done
26
- end
27
-
28
- # Assert that the thread can't be joined at this point
29
- thread.join(0).should be_nil
30
-
31
- waker.signal
32
- thread.value.should == :done
33
- end
34
- end