Sha256: c95e3b1e498729221bdf71b4d78981414966e529a7d001e6593551c8cbed2457

Contents?: true

Size: 501 Bytes

Versions: 6

Compression:

Stored size: 501 Bytes

Contents

require 'spec_helper'

describe Celluloid::ThreadHandle do
  it "knows thread liveliness" do
    queue = Queue.new
    handle = Celluloid::ThreadHandle.new { queue.pop }
    handle.should be_alive

    queue << :die

    sleep 0.01 # hax
    handle.should_not be_alive
  end

  it "joins to thread handles" do
    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

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
vagrant-tiktalik-0.0.3 vendor/bundle/ruby/2.0.0/gems/celluloid-0.15.2/spec/celluloid/thread_handle_spec.rb
celluloid-0.15.2 spec/celluloid/thread_handle_spec.rb
celluloid-0.15.1 spec/celluloid/thread_handle_spec.rb
celluloid-0.15.0 spec/celluloid/thread_handle_spec.rb
celluloid-0.15.0.pre2 spec/celluloid/thread_handle_spec.rb
celluloid-0.15.0.pre spec/celluloid/thread_handle_spec.rb