Sha256: 3bf3ffe7a24641c86480849e77345a81c7f86c843f5b9e4a740927e3ea7cda76
Contents?: true
Size: 1.23 KB
Versions: 71
Compression:
Stored size: 1.23 KB
Contents
require 'spec_helper' describe 'Parsing esoteric files and files causing ambiguous detection' do it 'correctly parses the test .docx files as Office docs' do docx_path = fixtures_dir + '/ZIP/10.docx' result = FormatParser.parse(File.open(docx_path, 'rb')) expect(result).not_to be_nil expect(result.nature).to eq(:document) end it 'does not return a result for a Keynote file when it mistakes it for a JPEG, and does not raise any errors' do jpeg_path = fixtures_dir + '/JPEG/keynote_recognized_as_jpeg.key' result = FormatParser.parse(File.open(jpeg_path, 'rb')) expect(result.nature).to eq(:archive) end it 'does not pick up JPG album art within an MP3 as a JPEG file' do jpeg_path = fixtures_dir + '/MP3/ATC Fixture With Album Art.mp3' results = FormatParser.parse(File.open(jpeg_path, 'rb'), results: :all) expect(results).to be_one expect(results.first.nature).to eq(:audio) end it 'returns a result for JPEG file that causes many reads due to too many APP1 markers' do jpeg_path = fixtures_dir + '/JPEG/too_many_APP1_markers_surrogate.jpg' result = FormatParser.parse(File.open(jpeg_path, 'rb')) expect(result).not_to be_nil expect(result.nature).to eq(:image) end end
Version data entries
71 entries across 71 versions & 1 rubygems