Sha256: 85c2eeda7be7590eca8da1f64b6d60eb09a964666e65cca4ad75752873543bfc

Contents?: true

Size: 1007 Bytes

Versions: 13

Compression:

Stored size: 1007 Bytes

Contents

require 'spec_helper'
require 'tempfile'

describe "Identity exports" do
  it "should export the simplest PSD" do
    filepath = 'spec/files/simplest.psd'
    psd = PSD.new(filepath)
    psd.parse!
    tmpfile = Tempfile.new("simplest_export.psd")
    psd.export tmpfile.path

    expect(Digest::MD5.hexdigest(tmpfile.read)).to eq(Digest::MD5.hexdigest(File.read(filepath)))
  end

  it "should export a file with a layer" do
    filepath = 'spec/files/one_layer.psd'
    psd = PSD.new(filepath)
    psd.parse!
    tmpfile = Tempfile.new("one_layer_export.psd")
    psd.export tmpfile.path

    expect(Digest::MD5.hexdigest(tmpfile.read)).to eq(Digest::MD5.hexdigest(File.read(filepath)))
  end

  it "should export a PSD with vector paths" do
    filepath = 'spec/files/path.psd'
    psd = PSD.new(filepath)
    psd.parse!
    tmpfile = Tempfile.new("path_export.psd")
    psd.export tmpfile.path

    expect(Digest::MD5.hexdigest(tmpfile.read)).to eq(Digest::MD5.hexdigest(File.read(filepath)))
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
psd-1.4.3 spec/identity_spec.rb
psd-1.4.2 spec/identity_spec.rb
psd-1.4.1 spec/identity_spec.rb
psd-1.4.0 spec/identity_spec.rb
psd-1.3.3 spec/identity_spec.rb
psd-1.3.2 spec/identity_spec.rb
psd-1.3.0 spec/identity_spec.rb
psd-1.2.2 spec/identity_spec.rb
psd-1.2.1 spec/identity_spec.rb
psd-1.2.0 spec/identity_spec.rb
psd-1.1.1 spec/identity_spec.rb
psd-1.1.0 spec/identity_spec.rb
psd-1.0.0 spec/identity_spec.rb