Sha256: 2b58f27d9e6f8fed0d7f6b5b0d6fe91f38acdc72f3ce3cdc42945d9c16ffa462

Contents?: true

Size: 649 Bytes

Versions: 9

Compression:

Stored size: 649 Bytes

Contents

require_relative '../../helper'

Tk.init

describe Tk::Image do
  Image = Tk::Image

  it 'creates photo image and return path' do
    Image.names.size.should == 0
    Image.create('photo').to_s.should == 'image1'
    Image.create('photo').to_s.should == 'image2'
    Image.names.should == ['image1', 'image2']

    Image.delete('image1', 'image2')
    Image.names.size.should == 0
  end

  it 'creates bitmap image and return path' do
    Image.create('bitmap').to_s.should == 'image3'
    Image.names.should == ['image3']
  end

  it 'raise RuntimeError if wrong type' do
    lambda { Image.create('unkown-') }.should.raise RuntimeError
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
ffi-tk-2010.08.23 spec/ffi-tk/command/image.rb
ffi-tk-2010.08 spec/ffi-tk/command/image.rb
ffi-tk-2010.06 spec/ffi-tk/command/image.rb
ffi-tk-2010.03 spec/ffi-tk/command/image.rb
ffi-tk-2010.02 spec/ffi-tk/command/image.rb
ffi-tk-2010.01 spec/ffi-tk/command/image.rb
ffi-tk-2010.01.02 spec/ffi-tk/command/image.rb
ffi-tk-2009.12.14 spec/ffi-tk/command/image.rb
ffi-tk-2009.11.29 spec/ffi-tk/command/image.rb