Sha256: 1941414098ce80f766a1f875c7c8392f6c2dacb2b83fe697c57e42cd2fed7bb2

Contents?: true

Size: 968 Bytes

Versions: 20

Compression:

Stored size: 968 Bytes

Contents

module Ddr::Derivatives
  RSpec.describe PngGenerator do

    describe "generate" do
      let(:tempdir) { Dir.mktmpdir }
      let(:output_file) { File.new(File.join(tempdir, "output.png"), 'wb') }
      let(:options) { "-resize '100x100>'" }
      let(:generator) { described_class.new(source, output_file.path, options) }
      after { FileUtils.rmdir(tempdir) }
      context "tiff source" do
        let(:source) { File.join(Ddr::Models::Engine.root, "spec", "fixtures", "imageA.tif") }
        it "should generate a non-empty file" do
          generator.generate
          expect(File.size(output_file.path)).to be > 0
        end
      end
      context "animated gif source" do
        let(:source) { File.join(Ddr::Models::Engine.root, "spec", "fixtures", "arrow1rightred_e0.gif") }
        it "should generate a non-empty file" do
          generator.generate
          expect(File.size(output_file.path)).to be > 0
        end
      end
    end

  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
ddr-models-2.11.0 spec/derivatives/png_generator_spec.rb
ddr-models-2.10.2 spec/derivatives/png_generator_spec.rb
ddr-models-2.10.1 spec/derivatives/png_generator_spec.rb
ddr-models-2.10.0 spec/derivatives/png_generator_spec.rb
ddr-models-2.10.0.rc2 spec/derivatives/png_generator_spec.rb
ddr-models-2.10.0.rc1 spec/derivatives/png_generator_spec.rb
ddr-models-2.9.2 spec/derivatives/png_generator_spec.rb
ddr-models-2.9.1 spec/derivatives/png_generator_spec.rb
ddr-models-2.9.0 spec/derivatives/png_generator_spec.rb
ddr-models-2.9.0.rc1 spec/derivatives/png_generator_spec.rb
ddr-models-2.8.0 spec/derivatives/png_generator_spec.rb
ddr-models-2.8.0.rc1 spec/derivatives/png_generator_spec.rb
ddr-models-2.7.6 spec/derivatives/png_generator_spec.rb
ddr-models-2.7.5 spec/derivatives/png_generator_spec.rb
ddr-models-2.7.4 spec/derivatives/png_generator_spec.rb
ddr-models-2.7.3 spec/derivatives/png_generator_spec.rb
ddr-models-2.7.2 spec/derivatives/png_generator_spec.rb
ddr-models-2.7.1 spec/derivatives/png_generator_spec.rb
ddr-models-2.7.0 spec/derivatives/png_generator_spec.rb
ddr-models-2.7.0.rc1 spec/derivatives/png_generator_spec.rb