Sha256: fcf05e3f2eaca4f88e53859aba38887b4c393c3538bb3fd7b78d102afe6d76c3

Contents?: true

Size: 527 Bytes

Versions: 2

Compression:

Stored size: 527 Bytes

Contents

require File.expand_path(File.dirname(__FILE__) + '/spec_helper')

describe "QueueToTheFuture" do
  it "should work" do
    start = Time.now.to_f
    
    f = Future(1, 2, 3) do |*args|
      sleep(0.1); args
    end
    
    QueueToTheFuture::Coordinator.instance.workforce_size.should be(1)
    f.inspect.should match(/^#<QueueToTheFuture::Job/)
    f.should eql([1,2,3])
    (Time.now.to_f - start).should be_close(0.1, 0.001)
    Thread.pass
    QueueToTheFuture::Coordinator.instance.workforce_size.should be(0)
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
queue_to_the_future-0.1.1 spec/queue_to_the_future_spec.rb
queue_to_the_future-0.1.0 spec/queue_to_the_future_spec.rb