test/lib/dmapparser/parser_test.rb in dmapparser-0.1.0 vs test/lib/dmapparser/parser_test.rb in dmapparser-0.2.0
- old
+ new
@@ -2,11 +2,11 @@
describe DMAPParser::Parser do
it 'should raise a ParserError when given invalid data' do
invalid = []
20.times do
- invalid << (0..255).map { |c| c.chr }.join # random data
+ invalid << (0..255).map(&:chr).join # random data
end
invalid << "rand\x00\x00\x00\x01" # non correct size
invalid << "mcon\x00\x00\x00\x05rand\x09" # wrong tag size
invalid << "msup\x00\x00\x00\x01\x01" # not a container!
invalid << "rand\x00\x00\x00\x01\x01" # not a container!
@@ -16,10 +16,10 @@
end.must_raise(DMAPParser::Parser::ParseError)
end
end
it 'should return nil if the string is empty' do
- DMAPParser::Parser.parse('').must_equal nil
+ -> { DMAPParser::Parser.parse('') }.must_raise DMAPParser::Parser::ParseError
end
it 'should ignore padding' do
dmap = support_file('simple.dmap').read
dmap.force_encoding(Encoding::BINARY)