Sha256: a8eb7936d6a26ccb1d437b506216f8b6c7e58af2b90e7923ef72a179c1d6f185

Contents?: true

Size: 735 Bytes

Versions: 121

Compression:

Stored size: 735 Bytes

Contents

require "#{File.dirname(__FILE__)}/spec_helper"

describe 'Syncronously sending to a Port' do
  it 'extends the length of the stream and preserves order' do
    local do |port, stream|
      unify port, Dataflow::Port.new(stream)
      port.send 1
      port.send 2
      stream.take(2).should == [1, 2]
      port.send 3
      stream.take(3).should == [1, 2, 3]
    end
  end
end

describe 'Asyncronously sending to a Port' do
  it 'extends the length of the stream and does not preserve order' do
    local do |port, stream|
      unify port, Dataflow::Port.new(stream)
      Thread.new {port.send 2}
      Thread.new {port.send 8}
      Thread.new {port.send 1024}
      stream.take(3).sort.should == [2, 8, 1024]
    end
  end
end

Version data entries

121 entries across 121 versions & 3 rubygems

Version Path
engineyard-serverside-1.2.2 lib/vendor/dataflow/spec/port_spec.rb
engineyard-serverside-1.2.1 lib/vendor/dataflow/spec/port_spec.rb
engineyard-serverside-1.2.0 lib/vendor/dataflow/spec/port_spec.rb
ey-deploy-1.1.3 lib/vendor/dataflow/spec/port_spec.rb
ey-deploy-1.1.2 lib/vendor/dataflow/spec/port_spec.rb
ey-deploy-1.1.1 lib/vendor/dataflow/spec/port_spec.rb
ey-deploy-1.1.0 lib/vendor/dataflow/spec/port_spec.rb
ey-deploy-1.0.2 lib/vendor/dataflow/spec/port_spec.rb
ey-deploy-1.0.1 lib/vendor/dataflow/spec/port_spec.rb
ey-deploy-1.0.0 lib/vendor/dataflow/spec/port_spec.rb
ey-deploy-0.9.1 lib/vendor/dataflow/spec/port_spec.rb
ey-deploy-0.8.2 lib/vendor/dataflow/spec/port_spec.rb
ey-deploy-0.8.1 lib/vendor/dataflow/spec/port_spec.rb
ey-deploy-0.8.0 lib/vendor/dataflow/spec/port_spec.rb
ey-deploy-0.7.1 lib/vendor/dataflow/spec/port_spec.rb
dataflow-0.3.1 spec/port_spec.rb
dataflow-0.3.0 spec/port_spec.rb
dataflow-0.2.0 spec/port_spec.rb
dataflow-0.2.1 spec/port_spec.rb
dataflow-0.1.1 spec/port_spec.rb