Skip to content

Commit

Permalink
Add spec for ThreadHandle role
Browse files Browse the repository at this point in the history
  • Loading branch information
halorgium committed May 13, 2013
1 parent 4402561 commit 9330bc5
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions spec/celluloid/thread_handle_spec.rb
Expand Up @@ -3,7 +3,7 @@
describe Celluloid::ThreadHandle do
it "knows thread liveliness" do
queue = Queue.new
handle = Celluloid::ThreadHandle.new(:useful) { queue.pop }
handle = Celluloid::ThreadHandle.new { queue.pop }
handle.should be_alive

queue << :die
Expand All @@ -13,6 +13,10 @@
end

it "joins to thread handles" do
Celluloid::ThreadHandle.new(:useful) { sleep 0.01 }.join
Celluloid::ThreadHandle.new { sleep 0.01 }.join
end

it "supports passing a role" do
Celluloid::ThreadHandle.new(:useful) { Thread.current.role.should == :useful }.join
end
end

0 comments on commit 9330bc5

Please sign in to comment.