Sha256: 8d8da7c0936319ae1e4e4841a80a118da5d22d17a1a1d47c35e076bf80c3ac54

Contents?: true

Size: 670 Bytes

Versions: 28

Compression:

Stored size: 670 Bytes

Contents

require 'spec_helper'

describe 'Text' do
  it "should parse text layer" do
    psd = PSD.new('spec/files/text.psd')
    psd.parse!

    text = psd.tree.children.first.text
    text.should be_an_instance_of(Hash)
    expect(text[:value]).to eq('Test')
  end

  it "can be exported as CSS" do
    psd = PSD.new('spec/files/text.psd')
    psd.parse!

    type = psd.tree.children.first.type
    css = type.to_css
    expect(css).to be_an_instance_of(String)
    expect(css).to include 'MyriadPro-Regular'
    expect(css).to include '37.0pt'
    expect(css).to include 'rgba(24, 24, 24, 255)'
    css.split(/\n/).each do |c|
      expect(c[-1]).to eq(";")
    end
  end
end

Version data entries

28 entries across 28 versions & 2 rubygems

Version Path
bench9000-0.1 vendor/psd.rb/spec/text_spec.rb
psd-3.2.2 spec/text_spec.rb
psd-3.2.1 spec/text_spec.rb
psd-3.2.0 spec/text_spec.rb
psd-3.1.5 spec/text_spec.rb
psd-3.1.4 spec/text_spec.rb
psd-3.1.3 spec/text_spec.rb
psd-3.1.2 spec/text_spec.rb
psd-2.1.2 spec/text_spec.rb
psd-2.1.1 spec/text_spec.rb
psd-2.1.0 spec/text_spec.rb
psd-2.0.0 spec/text_spec.rb
psd-1.5.0 spec/text_spec.rb
psd-1.4.5 spec/text_spec.rb
psd-1.4.4 spec/text_spec.rb
psd-1.4.3 spec/text_spec.rb
psd-1.4.2 spec/text_spec.rb
psd-1.4.1 spec/text_spec.rb
psd-1.4.0 spec/text_spec.rb
psd-1.3.3 spec/text_spec.rb