Sha256: 50482aa2fb72d55f33ecca4777e8c04a4d370436ed1d8866303c5f8079c6d1a7
Contents?: true
Size: 660 Bytes
Versions: 2
Compression:
Stored size: 660 Bytes
Contents
require 'anise/attribute' class Test_Attribute < Test::Unit::TestCase class X include Anise::Attribute attr :q attr :a, :x => 1 end def test_attr_a assert_equal( {:x=>1}, X.ann(:a) ) end end class Test_Attribute_Using_Attr < Test::Unit::TestCase class A include Anise::Attribute attr :x, :cast=>"to_s" end def test_01 assert_equal( "to_s", A.ann(:x,:cast) ) end end class Test_Attribute_Using_Attr_Accessor < Test::Unit::TestCase class A include Anise::Attribute attr_accessor :x, :cast=>"to_s" end def test_01 a = A.new assert_equal( [:x], A.instance_attributes - [:taguri] ) end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
anise-0.6.0 | test/test_attribute.rb |
anise-0.5.0 | test/test_attribute.rb |