Sha256: 9ef5178234db111dc4da4b7e137ca3aced734276e9573f72a93985b057e4167c

Contents?: true

Size: 1.04 KB

Versions: 39

Compression:

Stored size: 1.04 KB

Contents

require 'spec_helper'

module Ddr::Derivatives
  RSpec.describe PtifGenerator do

    describe "generate" do
      let(:tempdir) { Dir.mktmpdir }
      let(:output_path) { File.join(tempdir, "output.ptif") }
      let(:options) { "jpeg:90,tile:256x256,pyramid" }
      let(:generator) { described_class.new(options) }
      after { FileUtils.rmdir(tempdir) }
      context "tiff source" do
        context "8-bit source" do
          let(:source_path) { File.join(Ddr::Models::Engine.root, "spec", "fixtures", "8bit.tif") }
          it "should generate a non-empty file" do
            generator.generate(source_path, output_path)
            expect(File.size(output_path)).to be > 0
          end
        end
        context "16-bit source" do
          let(:source_path) { File.join(Ddr::Models::Engine.root, "spec", "fixtures", "16bit.tif") }
          it "should generate a non-empty file" do
            generator.generate(source_path, output_path)
            expect(File.size(output_path)).to be > 0
          end
        end
      end
    end

  end
end

Version data entries

39 entries across 39 versions & 1 rubygems

Version Path
ddr-models-3.0.8 spec/derivatives/ptif_generator_spec.rb
ddr-models-3.0.7 spec/derivatives/ptif_generator_spec.rb
ddr-models-3.0.6 spec/derivatives/ptif_generator_spec.rb
ddr-models-3.0.5 spec/derivatives/ptif_generator_spec.rb
ddr-models-3.0.4 spec/derivatives/ptif_generator_spec.rb
ddr-models-3.0.3 spec/derivatives/ptif_generator_spec.rb
ddr-models-3.0.2 spec/derivatives/ptif_generator_spec.rb
ddr-models-3.0.1 spec/derivatives/ptif_generator_spec.rb
ddr-models-3.0.0 spec/derivatives/ptif_generator_spec.rb
ddr-models-3.0.0.rc6 spec/derivatives/ptif_generator_spec.rb
ddr-models-3.0.0.rc5 spec/derivatives/ptif_generator_spec.rb
ddr-models-3.0.0.rc4 spec/derivatives/ptif_generator_spec.rb
ddr-models-3.0.0.rc3 spec/derivatives/ptif_generator_spec.rb
ddr-models-3.0.0.rc2 spec/derivatives/ptif_generator_spec.rb
ddr-models-3.0.0.rc1 spec/derivatives/ptif_generator_spec.rb
ddr-models-3.0.0.beta.22 spec/derivatives/ptif_generator_spec.rb
ddr-models-3.0.0.beta.21 spec/derivatives/ptif_generator_spec.rb
ddr-models-3.0.0.beta.20 spec/derivatives/ptif_generator_spec.rb
ddr-models-3.0.0.beta.18 spec/derivatives/ptif_generator_spec.rb
ddr-models-3.0.0.beta.17 spec/derivatives/ptif_generator_spec.rb