Sha256: 6768cbf08c7787df60e2bfee7dfd05657d6078c1323117f45a34c25323e33e4b

Contents?: true

Size: 414 Bytes

Versions: 3

Compression:

Stored size: 414 Bytes

Contents

require 'test/unit'
require 'attributable'
require 'utils'

class AttrClass
  include Attributable

  attribute :a, 1.0
  attribute :b, nil, Float
  attribute :c
end


# Test class
class AttributableTest < Test::Unit::TestCase
  
  def test_nominal
    obj = AttrClass[ :b, 2.0, :c, 3.0 ]
    assert_equal( 1.0, obj.a)
    assert_equal( 2.0, obj.b)
    assert_equal( 3.0, obj.c)
  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
xrvg-0.0.1 test/test_attributable.rb
xrvg-0.0.2 test/test_attributable.rb
xrvg-0.0.3 test/test_attributable.rb