Sha256: 5e9540b0fe49a3255d96fc8978e8f886b811c14f9cabde62c0cd7ce1ea582aa7
Contents?: true
Size: 1.17 KB
Versions: 5
Compression:
Stored size: 1.17 KB
Contents
require 'spec_helper' describe FormatParser::JPEGParser do describe 'is able to parse all the examples from FastImage' do Dir.glob(fixtures_dir + '/*.jpg').each do |jpeg_path| it "is able to parse #{File.basename(jpeg_path)}" do parsed = subject.call(File.open(jpeg_path, 'rb')) expect(parsed).not_to be_nil expect(parsed.nature).to eq(:image) expect(parsed.format).to eq(:jpg) 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 JPEG exif examples from FastImage' do Dir.glob(fixtures_dir + '/exif-orientation-testimages/jpg/*.jpg').each do |jpeg_path| it "is able to parse #{File.basename(jpeg_path)}" do parsed = subject.call(File.open(jpeg_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 end
Version data entries
5 entries across 5 versions & 1 rubygems