Sha256: b17b9b4706edf450b821eb74d20e0865704fdf6ed65e0268743d868eec170c1c
Contents?: true
Size: 1.48 KB
Versions: 14
Compression:
Stored size: 1.48 KB
Contents
require 'spec_helper' describe FormatParser::TIFFParser do describe 'is able to parse all the examples from FastImage' do Dir.glob(fixtures_dir + '/TIFF/*.tif').each do |tiff_path| it "is able to parse #{File.basename(tiff_path)}" do parsed = subject.call(File.open(tiff_path, 'rb')) expect(parsed).not_to be_nil expect(parsed.nature).to eq(:image) expect(parsed.format).to eq(:tif) expect(parsed.width_px).to be_kind_of(Integer) expect(parsed.width_px).to be > 0 expect(parsed.height_px).to be_kind_of(Integer) expect(parsed.height_px).to be > 0 end end end describe 'is able to parse all the TIFF exif examples from FastImage' do Dir.glob(fixtures_dir + '/exif-orientation-testimages/tiff-*/*.tif').each do |tiff_path| it "is able to parse #{File.basename(tiff_path)}" do parsed = subject.call(File.open(tiff_path, 'rb')) expect(parsed).not_to be_nil expect(parsed.orientation).to be_kind_of(Symbol) expect(parsed.width_px).to be > 0 expect(parsed.height_px).to be_kind_of(Integer) expect(parsed.height_px).to be > 0 end end end describe 'is able to return nil when parsing CR2 examples' do Dir.glob(fixtures_dir + '/CR2/*.CR2').each do |cr2_path| it "is able to return nil when parsing #{File.basename(cr2_path)}" do parsed = subject.call(File.open(cr2_path, 'rb')) expect(parsed).to be_nil end end end end
Version data entries
14 entries across 14 versions & 1 rubygems