Sha256: 1f0d86a594fedc3407a96423605d76d3b7934f804876d9b8133af98f7caeb0cf

Contents?: true

Size: 487 Bytes

Versions: 11

Compression:

Stored size: 487 Bytes

Contents

$:.unshift File.join(File.dirname(__FILE__), '..', '..', 'lib')

require 'test/unit'
require 'glue/attribute'

class TC_Attribute < Test::Unit::TestCase # :nodoc: all

  class Dummy
    cattr_accessor :value, 'Default'
    cattr_reader :reader, 3
  end

  def test_attr
    assert_equal 'Default', Dummy.value
    assert_nothing_raised { Dummy.value = 2 }
    assert_equal 2, Dummy.value

    assert_equal 3, Dummy.reader
    assert_raise(NoMethodError) { Dummy.reader = 19 }
  end

end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
glue-0.21.0 test/glue/tc_attribute.rb
glue-0.21.2 test/glue/tc_attribute.rb
glue-0.22.0 test/glue/tc_attribute.rb
glue-0.23.0 test/glue/tc_attribute.rb
glue-0.24.0 test/glue/tc_attribute.rb
glue-0.25.0 test/glue/tc_attribute.rb
glue-0.26.0 test/glue/tc_attribute.rb
glue-0.27.0 test/glue/tc_attribute.rb
glue-0.28.0 test/glue/tc_attribute.rb
glue-0.29.0 test/glue/tc_attribute.rb
glue-0.30.0 test/glue/tc_attribute.rb