Skip to content

Commit

Permalink
Add a spec around using custom Thread methods
Browse files Browse the repository at this point in the history
  • Loading branch information
halorgium committed May 15, 2013
1 parent 05a2517 commit 21ac8c8
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions spec/celluloid/thread_handle_spec.rb
Expand Up @@ -19,4 +19,17 @@
it "supports passing a role" do
Celluloid::ThreadHandle.new(:useful) { Thread.current.role.should == :useful }.join
end

it "supports method access" do
results = []

Celluloid::ThreadHandle.new(:method_access) {
results << Thread.current.role
Fiber.new {
results << Thread.current.role
}.resume
}.join

results.should == [:method_access, nil]
end
end

0 comments on commit 21ac8c8

Please sign in to comment.