Permalink
Browse files

adding tests for double64 type

  • Loading branch information...
aberant committed Aug 18, 2013
1 parent 9d43128 commit c3c092afff2b5355be5d0973df822676e8a241f3
Showing with 21 additions and 0 deletions.
  1. +5 −0 spec/builders/message_builder.rb
  2. +10 −0 spec/unit/osc_simple_packets_spec.rb
  3. +6 −0 spec/unit/osc_types_spec.rb
@@ -16,6 +16,11 @@ def with_float( float )
with_arg( "f", float )
self
end
+
+ def with_double( double )
+ with_arg( "d", double)
+ self
+ end
def with_int( int )
with_arg( "i", int )
@@ -105,4 +105,14 @@
args = msg.first.to_a
args.first.must_equal( @first_blob )
end
+
+ it "should decode messages with double64 types" do
+ pi = 3.14159
+
+ sent_msg = @builder.with_double( pi ).build
+ msg = OSC::OSCPacket.messages_from_network( sent_msg.encode )
+
+ args = msg.first.to_a
+ args.first.must_be_close_to( pi, 0.001 )
+ end
end
@@ -12,6 +12,12 @@
end
end
+describe OSC::OSCDouble64 do
+ it "should not blow up" do
+ OSC::OSCDouble64.new 1.0
+ end
+end
+
describe OSC::OSCString do
it "should not blow up" do
OSC::OSCString.new "1"

0 comments on commit c3c092a

Please sign in to comment.