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.0.beta.16 spec/derivatives/ptif_generator_spec.rb
ddr-models-3.0.0.beta.15 spec/derivatives/ptif_generator_spec.rb
ddr-models-3.0.0.beta.14 spec/derivatives/ptif_generator_spec.rb
ddr-models-3.0.0.beta.13 spec/derivatives/ptif_generator_spec.rb
ddr-models-3.0.0.beta.12 spec/derivatives/ptif_generator_spec.rb
ddr-models-3.0.0.beta.11 spec/derivatives/ptif_generator_spec.rb
ddr-models-3.0.0.beta.10 spec/derivatives/ptif_generator_spec.rb
ddr-models-3.0.0.beta.9 spec/derivatives/ptif_generator_spec.rb
ddr-models-3.0.0.beta.8 spec/derivatives/ptif_generator_spec.rb
ddr-models-3.0.0.beta.7 spec/derivatives/ptif_generator_spec.rb
ddr-models-3.0.0.beta.6 spec/derivatives/ptif_generator_spec.rb
ddr-models-3.0.0.beta.4 spec/derivatives/ptif_generator_spec.rb
ddr-models-3.0.0.beta.3 spec/derivatives/ptif_generator_spec.rb
ddr-models-3.0.0.beta.2 spec/derivatives/ptif_generator_spec.rb
ddr-models-3.0.0.beta.1 spec/derivatives/ptif_generator_spec.rb
ddr-models-3.0.0.alpha.4 spec/derivatives/ptif_generator_spec.rb
ddr-models-3.0.0.alpha.3 spec/derivatives/ptif_generator_spec.rb
ddr-models-3.0.0.alpha.2 spec/derivatives/ptif_generator_spec.rb
ddr-models-3.0.0.alpha.1 spec/derivatives/ptif_generator_spec.rb