test/lib/dmapparser/parser_test.rb in dmapparser-0.0.1 vs test/lib/dmapparser/parser_test.rb in dmapparser-0.0.2

- old
+ new

@@ -18,10 +18,11 @@ DMAPParser::Parser.parse('').must_equal nil end it 'should ignore padding' do dmap = support_file('simple.dmap').read + dmap.force_encoding(Encoding::BINARY) padded = DMAPParser::Parser.parse(dmap + 'I AM PADDING!!11!!') padded.to_dmap.must_equal dmap end it 'should parse an empty container' do @@ -56,6 +57,12 @@ data = "mcon\x00\x00\x00\x0Ajurp\x00\x00\x00\x02\x13\x37" data = DMAPParser::Parser.parse(data) data.jurp.must_equal 0x1337 end + it 'should parse strings as UTF-8' do + dmap = DMAPParser::Builder.cmpa do + cmnm '4E0573EF9BB80682' + end.to_dmap + DMAPParser::Parser.parse(dmap).cmnm.encoding.must_equal(Encoding::UTF_8) + end end