Sha256: 6d09b7e90c46aff20c5b7601bb71158b085a1baa596c123688def66235c720ac

Contents?: true

Size: 442 Bytes

Versions: 1

Compression:

Stored size: 442 Bytes

Contents

# Test facets/attributes.rb

require 'facets/attributes.rb'

require 'test/unit'

class TC_Attributes_Using_Attr < Test::Unit::TestCase
  class A
    attr :x, :cast=>"to_s"
  end

  def test_01
    assert_equal( "to_s", A.ann(:x,:cast) )
  end
end

class TC_Attributes_Using_Attr_Accessor < Test::Unit::TestCase
  class A
    attr_accessor :x, :cast=>"to_s"
  end

  def test_01
    a = A.new
    assert_equal( [:x], A.attributes )
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
facets-2.1.3 test/unit/test_attributes.rb