test/lib/dmapparser/parser_test.rb in dmapparser-0.0.2 vs test/lib/dmapparser/parser_test.rb in dmapparser-0.1.0
- old
+ new
@@ -1,11 +1,14 @@
require_relative '../../test_helper'
describe DMAPParser::Parser do
it 'should raise a ParserError when given invalid data' do
invalid = []
- invalid << (0..255).map { |c| c.chr }.join # random data
+ 20.times do
+ invalid << (0..255).map { |c| c.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!
invalid.each do |data|
lambda do
DMAPParser::Parser.parse(data)