Sha256: 508dba3681cccf3cc6da162948f514355057190b24a809e60f66cea9c998005a
Contents?: true
Size: 626 Bytes
Versions: 16
Compression:
Stored size: 626 Bytes
Contents
$: << File.expand_path(File.dirname(__FILE__) + '/../lib') require 'rubygems' require 'test/unit' require 'valuable.rb' require 'mocha' class Parent < Valuable has_value :name, :default => 'unknown' end class Child < Parent has_value :age end class InheritanceTest < Test::Unit::TestCase def test_that_children_inherit_their_parents_attributes assert Child.attributes.include?(:name) end def test_that_children_have_distinctive_attributes assert Child.attributes.include?(:age) end def test_that_parents_do_not_inherit_things_from_children assert_equal [:name], Parent.attributes end end
Version data entries
16 entries across 16 versions & 1 rubygems