Sha256: cb7cb1eeea67db4106bdfa4578827d76d26f8a2d91010050428592847f1d45ff

Contents?: true

Size: 806 Bytes

Versions: 9

Compression:

Stored size: 806 Bytes

Contents

require File.join( File.dirname(__FILE__) , '..', 'spec_helper' )


describe OSC::NetworkPacket do
  before :each do
    @empty = OSC::NetworkPacket.new( "" )
    @simple = OSC::NetworkPacket.new( "abc" )
  end
  
  it "should know if it's at the end of the stream" do
    @empty.eof?.should be_true
  end
  
  it "should know the remainder in the stream" do
    @simple.rem.should == 3
  end
  
  it "should be able to skip positions" do
    @simple.skip( 1 )
    @simple.rem.should == 2
  end
  
  it "should be able to get a character from the stream" do
    @simple.getc.should == ?a
    @simple.getc.should == ?b
    @simple.getc.should == ?c
    @simple.eof?.should be_true
  end
  
  it "should be able to get a number of characters from the stream" do
    @simple.getn(3).should == "abc"
  end
end

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
aberant-osc-ruby-0.1.6 spec/unit/network_packet_spec.rb
aberant-osc-ruby-0.2.0 spec/unit/network_packet_spec.rb
osc-ruby-1.0.0 spec/unit/network_packet_spec.rb
osc-ruby-0.7.0 spec/unit/network_packet_spec.rb
osc-ruby-0.6.3 spec/unit/network_packet_spec.rb
osc-ruby-0.6.2 spec/unit/network_packet_spec.rb
osc-ruby-0.6.1 spec/unit/network_packet_spec.rb
osc-ruby-0.6.0 spec/unit/network_packet_spec.rb
osc-ruby-0.2.0 spec/unit/network_packet_spec.rb