Sha256: 0be2a7fc4c4e1ada5523cda690108dc01a21412a143e1193e48cbefd9e755897

Contents?: true

Size: 934 Bytes

Versions: 23

Compression:

Stored size: 934 Bytes

Contents

require 'spec_helper'

describe 'Guides' do
  describe "Handle file with slice properly" do
    it "should successfully parse the PSD file that has guides" do
      psd = PSD.new('spec/files/guides.psd')
      psd.parse!

      # File should parse
      expect(psd).to be_parsed

      # Guides should not be nil
      expect(psd.resources[:guides]).to_not be_nil

      # Each guide should have a position and direction
      psd.resources[:guides].data.to_a.each do |guide|
        expect(guide).to_not be_nil
        expect(guide[:location]).to_not be_nil
        expect(guide[:direction]).to_not be_nil
      end
    end
  end

  describe "Handle file without guides properly" do
    it "should successfully parse a PSD file which does not have guides" do
      psd = PSD.new('spec/files/simplest.psd')
      psd.parse!

      expect(psd).to be_parsed

      expect(psd.resources[:guides].data.to_a.size).to be 0
    end
  end
end

Version data entries

23 entries across 23 versions & 2 rubygems

Version Path
psd-3.9.0 spec/guides_spec.rb
psd-3.8.0 spec/guides_spec.rb
psd-3.7.0 spec/guides_spec.rb
psd-3.6.0 spec/guides_spec.rb
bench9000-0.1 vendor/psd.rb/spec/guides_spec.rb
psd-3.5.0 spec/guides_spec.rb
psd-3.4.0 spec/guides_spec.rb
psd-3.3.3 spec/guides_spec.rb
psd-3.3.2 spec/guides_spec.rb
psd-3.3.1 spec/guides_spec.rb
psd-3.2.4 spec/guides_spec.rb
psd-3.2.3 spec/guides_spec.rb
psd-3.2.2 spec/guides_spec.rb
psd-3.2.1 spec/guides_spec.rb
psd-3.2.0 spec/guides_spec.rb
psd-3.1.5 spec/guides_spec.rb
psd-3.1.4 spec/guides_spec.rb
psd-3.1.3 spec/guides_spec.rb
psd-3.1.2 spec/guides_spec.rb
psd-2.1.2 spec/guides_spec.rb