test/fattr.rb in fattr-2.0.0 vs test/fattr.rb in fattr-2.1.0

- old
+ new

@@ -63,24 +63,30 @@ testing 'that fattrs support simple class inheritable attributes' do a = Class.new{ Fattr :x, :default => 42, :inheritable => true } b = Class.new(a) c = Class.new(b) + def a.name() 'a' end def b.name() 'b' end def c.name() 'c' end + assert{ c.x==42 } assert{ b.x==42 } assert{ a.x==42 } + assert{ b.x=42.0 } assert{ b.x==42.0 } assert{ a.x==42 } + assert{ a.x='forty-two' } assert{ a.x=='forty-two' } assert{ b.x==42.0 } + assert{ b.x! } assert{ b.x=='forty-two' } assert{ b.x='FORTY-TWO' } + assert{ c.x! } assert{ c.x=='FORTY-TWO' } end testing 'a list of fattrs can be declared at once' do