test/mockspotify_spec.rb in mockspotify-0.1.2 vs test/mockspotify_spec.rb in mockspotify-0.1.3

- old
+ new

@@ -26,6 +26,24 @@ it "should have the proper load status" do Spotify.artist_is_loaded(@artist).must_equal true end end + + describe "hextoa" do + it "should convert a hexidecimal string properly" do + Spotify.attach_function :hextoa, [:string, :int], :string + Spotify.hextoa("3A3A", 4).must_equal "::" + end + end + + describe "atohex" do + it "should convert a byte string to a hexadecimal string" do + Spotify.attach_function :atohex, [:buffer_out, :buffer_in, :int], :void + + FFI::Buffer.alloc_out(8) do |b| + Spotify.atohex(b, "\x3A\x3A\x0F\xF1", b.size) + b.get_string(0, b.size).must_equal "3a3a0ff1" + end + end + end end