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.4.15 lib/vendor/dataflow/spec/port_spec.rb
engineyard-serverside-1.4.14 lib/vendor/dataflow/spec/port_spec.rb
engineyard-serverside-1.4.13 lib/vendor/dataflow/spec/port_spec.rb
engineyard-serverside-1.4.12 lib/vendor/dataflow/spec/port_spec.rb
engineyard-serverside-1.4.11 lib/vendor/dataflow/spec/port_spec.rb
engineyard-serverside-1.4.9.nodestack lib/vendor/dataflow/spec/port_spec.rb
engineyard-serverside-1.4.8.nodestack lib/vendor/dataflow/spec/port_spec.rb
engineyard-serverside-1.4.7.pre lib/vendor/dataflow/spec/port_spec.rb
engineyard-serverside-1.4.3.nodestack lib/vendor/dataflow/spec/port_spec.rb
engineyard-serverside-1.4.1 lib/vendor/dataflow/spec/port_spec.rb
engineyard-serverside-1.4.0 lib/vendor/dataflow/spec/port_spec.rb
engineyard-serverside-1.3.7 lib/vendor/dataflow/spec/port_spec.rb
engineyard-serverside-1.3.6 lib/vendor/dataflow/spec/port_spec.rb
engineyard-serverside-1.3.5 lib/vendor/dataflow/spec/port_spec.rb
engineyard-serverside-1.3.4 lib/vendor/dataflow/spec/port_spec.rb
engineyard-serverside-1.3.4.jruby.2 lib/vendor/dataflow/spec/port_spec.rb
engineyard-serverside-1.3.3 lib/vendor/dataflow/spec/port_spec.rb
engineyard-serverside-1.3.2 lib/vendor/dataflow/spec/port_spec.rb
engineyard-serverside-1.3.1 lib/vendor/dataflow/spec/port_spec.rb
engineyard-serverside-1.3.0 lib/vendor/dataflow/spec/port_spec.rb