Sha256: 252535167aa9f73e865289a698a16b077b5b0b1cb64fe0b9ceac99cdcb271450

Contents?: true

Size: 920 Bytes

Versions: 8

Compression:

Stored size: 920 Bytes

Contents

require File.dirname(__FILE__) + '/test_helper.rb'

context "A port" do
  specify "should return terms from the queue if it is not empty" do
    port = FakePort.new()
    port.queue.clear
    port.queue << :foo << :bar
    port.receive.should == :foo
    port.receive.should == :bar
    port.receive.should == nil
  end

  specify "should read_from_input if the queue gets empty" do
    port = FakePort.new(:bar)
    port.queue.clear
    port.queue << :foo
    port.receive.should == :foo
    port.receive.should == :bar
    port.receive.should == nil
  end

  specify "should put the terms in skipped at the front of queue when restore_skipped is called" do
    port = FakePort.new(:baz)
    port.queue.clear
    port.queue << :bar
    port.skipped << :foo
    port.restore_skipped

    port.receive.should == :foo
    port.receive.should == :bar
    port.receive.should == :baz
    port.receive.should == nil
  end
end

Version data entries

8 entries across 8 versions & 3 rubygems

Version Path
mojombo-erlectricity-1.0.0 test/port_spec.rb
mojombo-erlectricity-1.0.1 test/port_spec.rb
mojombo-erlectricity-1.0.2 test/port_spec.rb
erlectricity-funbox-1.1.2 test/port_spec.rb
erlectricity-1.1.1 test/port_spec.rb
erlectricity-1.1.0 test/port_spec.rb
erlectricity-1.0.0 test/port_spec.rb
erlectricity-1.0.1 test/port_spec.rb