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-2.0.4 lib/vendor/dataflow/spec/port_spec.rb
engineyard-serverside-1.6.5 lib/vendor/dataflow/spec/port_spec.rb
engineyard-serverside-2.0.3 lib/vendor/dataflow/spec/port_spec.rb
engineyard-serverside-2.0.2 lib/vendor/dataflow/spec/port_spec.rb
engineyard-serverside-2.0.1 lib/vendor/dataflow/spec/port_spec.rb
engineyard-serverside-2.0.0 lib/vendor/dataflow/spec/port_spec.rb
engineyard-serverside-2.0.0.rc1 lib/vendor/dataflow/spec/port_spec.rb
engineyard-serverside-2.0.0.pre5 lib/vendor/dataflow/spec/port_spec.rb
engineyard-serverside-2.0.0.pre4 lib/vendor/dataflow/spec/port_spec.rb
engineyard-serverside-2.0.0.pre3 lib/vendor/dataflow/spec/port_spec.rb
engineyard-serverside-2.0.0.pre2 lib/vendor/dataflow/spec/port_spec.rb
engineyard-serverside-2.0.0.pre1 lib/vendor/dataflow/spec/port_spec.rb
engineyard-serverside-1.7.0.pre2 lib/vendor/dataflow/spec/port_spec.rb
engineyard-serverside-1.6.4 lib/vendor/dataflow/spec/port_spec.rb
engineyard-serverside-1.6.4.pre6 lib/vendor/dataflow/spec/port_spec.rb
engineyard-serverside-1.6.4.pre5 lib/vendor/dataflow/spec/port_spec.rb
engineyard-serverside-1.6.4.pre4 lib/vendor/dataflow/spec/port_spec.rb
engineyard-serverside-1.6.4.pre3 lib/vendor/dataflow/spec/port_spec.rb
engineyard-serverside-1.6.4.pre2 lib/vendor/dataflow/spec/port_spec.rb
engineyard-serverside-1.6.4.pre lib/vendor/dataflow/spec/port_spec.rb