Sha256: eafefd8ea4aed2b57e9c0c63182befdd68ca3744072866e357cb53a0c08fba18

Contents?: true

Size: 469 Bytes

Versions: 15

Compression:

Stored size: 469 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

15 entries across 15 versions & 2 rubygems

Version Path
glue-0.15.0 test/glue/tc_attribute.rb
glue-0.13.0 test/glue/tc_attribute.rb
glue-0.14.0 test/glue/tc_attribute.rb
glue-0.16.0 test/glue/tc_attribute.rb
glue-0.17.0 test/glue/tc_attribute.rb
glue-0.18.0 test/glue/tc_attribute.rb
glue-0.18.1 test/glue/tc_attribute.rb
glue-0.19.0 test/glue/tc_attribute.rb
glue-0.20.0 test/glue/tc_attribute.rb
nitro-0.10.0 test/glue/tc_attribute.rb
nitro-0.11.0 test/glue/tc_attribute.rb
nitro-0.12.0 test/glue/tc_attribute.rb
nitro-0.8.0 test/glue/tc_attribute.rb
nitro-0.9.3 test/glue/tc_attribute.rb
nitro-0.9.5 test/glue/tc_attribute.rb