Sha256: 6e29521d0a1658146a6b74db0ed2135cff82625610b0d9f23deb3f3ecc6f9f94

Contents?: true

Size: 488 Bytes

Versions: 9

Compression:

Stored size: 488 Bytes

Contents

require_relative '../helper'

Tk.init

describe Tk::Variable do
  it 'creates a Variable' do
    @var = Tk::Variable.new('somevar')
    @var.name.should == "somevar"
  end

  it 'cannot get a value from it yet' do
    lambda{ @var.get }.should.raise(NameError)
  end

  it 'sets the value and retrieves it' do
    @var.set('Hello, World!')
    @var.to_s.should == 'Hello, World!'
  end

  it 'unsets the variable' do
    @var.unset
    lambda{ @var.get }.should.raise(NameError)
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

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