Sha256: 6bf02e515c3493d6652abb54050777d42671b32a5446f30dafded9289db8279e

Contents?: true

Size: 611 Bytes

Versions: 26

Compression:

Stored size: 611 Bytes

Contents

require 'spec_helper'

describe PSD::LazyExecute do
  before(:each) do
    @psd = PSD.new('spec/files/pixel.psd')
  end

  it 'initializes correctly' do
    expect(@psd.image).to be_an_instance_of(PSD::LazyExecute)
    expect(@psd.image).to_not be_loaded
    expect(@psd.image.instance_variable_get(:@obj)).to be_an_instance_of(PSD::Image)
    expect(@psd.image.instance_variable_get(:@start_pos)).to eq @psd.file.tell
    expect(@psd.image.instance_variable_get(:@load_method)).to eq :parse
  end

  it 'loads when accessed the first time' do
    @psd.image.to_png
    expect(@psd.image).to be_loaded
  end
end

Version data entries

26 entries across 26 versions & 2 rubygems

Version Path
psd-2.1.1 spec/lazy_execute_spec.rb
psd-2.1.0 spec/lazy_execute_spec.rb
psd-2.0.0 spec/lazy_execute_spec.rb
psd-1.5.0 spec/lazy_execute_spec.rb
psd-1.4.5 spec/lazy_execute_spec.rb
psd-1.4.4 spec/lazy_execute_spec.rb