Sha256: 41f7b0ca94d49f7204d9ca1cc983f4bceb0b52d71d17a97df6691f378ce40929

Contents?: true

Size: 1.13 KB

Versions: 3

Compression:

Stored size: 1.13 KB

Contents

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


describe OSC::OSCPacket do
  before :each do
    @complex_packet = "#bundle\000\316\034\315T\000\003\030\370\000\000\000$/tuio/2Dobj\000,ss\000source\000\000simulator\000\000\000\000\000\000\030/tuio/2Dobj\000,s\000\000alive\000\000\000\000\000\000\034/tuio/2Dobj\000,si\000fseq\000\000\000\000\377\377\377\377"
    
    @messages = OSC::OSCPacket.messages_from_network( @complex_packet ) 
  end
  
  it "should have three messages" do
    @messages.size.must_equal 3
  end
  
  it "should have the propper address for the messages" do
    3.times do |i|
      @messages[i].address.must_equal("/tuio/2Dobj")
    end
  end
  
  it "should have a first message with two strings" do
    args = @messages[0].to_a
    
    args[0].must_equal( "source" )
    args[1].must_equal( "simulator" )
  end
  
  it "should have a second message with one string" do
    args = @messages[1].to_a
    args[0].must_equal( "alive" )
  end
  
  it "should have a third message with a string and an int" do
    args = @messages[2].to_a
    
    args[0].must_equal( "fseq" )
    args[1].must_equal(-1)
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
osc-ruby-1.1.3 spec/unit/osc_complex_packets_spec.rb
osc-ruby-1.1.2 spec/unit/osc_complex_packets_spec.rb
osc-ruby-1.1.1 spec/unit/osc_complex_packets_spec.rb