Sha256: a69bd86dd2894d0013fe3363a612474f815196b2fb967b5c7cbcbfa898862cf3

Contents?: true

Size: 426 Bytes

Versions: 3

Compression:

Stored size: 426 Bytes

Contents

require "spec_helper"

describe "Agent.go!" do
  it "should launch a 'goroutine' that is actually a thread" do
    Agent.go!{}.should be_a(Thread)
  end

  it "should pass into the thread any arguments passed to it" do
    b = nil
    Agent.go!(1){|a| b = a }.join
    b.should == 1
  end

  it "should raise an error if no block is passed" do
    lambda{ Agent.go! }.should raise_error(Agent::Errors::BlockMissing)
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
agent-0.10.0 spec/go_spec.rb
agent-0.9.1 spec/go_spec.rb
agent-0.9.0 spec/go_spec.rb