Skip to content

Commit

Permalink
Simplifying test setup. Ditching fixture in favor of expliciting asse…
Browse files Browse the repository at this point in the history
…mbling the error scenario in code
  • Loading branch information
rcpalacio committed Sep 14, 2023
1 parent b713c05 commit 916b1cb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Binary file removed spec/fixtures/MP4/invalid/inconsistent_ftyp_box.mp4
Binary file not shown.
7 changes: 4 additions & 3 deletions spec/parsers/mp4_parser_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,11 @@
end
end

context "when the 'ftyp' box can't be parsed" do
context "when when magic bytes are present but the 'ftyp' box can't be parsed" do
let(:result) do
path = fixtures_dir + '/MP4/invalid/inconsistent_ftyp_box.mp4'
subject.call(File.open(path, 'rb'))
input = [0xFF].pack('N') + 'ftyp' + 'avc1 ' + [0x1].pack('N')
io = StringIO.new(input)
subject.call(io)
end

it 'should be nil' do
Expand Down

0 comments on commit 916b1cb

Please sign in to comment.