Sha256: 2819ef7b9331061147696f624cc1743613fe3ae75ef913a0aa87a439b6c6aba2

Contents?: true

Size: 648 Bytes

Versions: 4

Compression:

Stored size: 648 Bytes

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
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
format_parser-0.9.0 spec/esoteric_formats_spec.rb
format_parser-0.8.0 spec/esoteric_formats_spec.rb
format_parser-0.7.0 spec/esoteric_formats_spec.rb
format_parser-0.6.0 spec/esoteric_formats_spec.rb