require 'pathname' require Pathname.new( File.dirname(__FILE__)).join( 'test_helper' ).cleanpath require 'build-tool/feature' class TestFeature < Test::Unit::TestCase def test_simple_creation testfeat = BuildTool::Feature.new( "test" ) assert_equal "test", testfeat.name assert testfeat.active? assert_nil testfeat.parent assert_equal "test", testfeat.path test2feat = BuildTool::Feature.new( "test2", testfeat, false ) assert_equal "test2", test2feat.name assert !test2feat.active? assert_equal testfeat, test2feat.parent assert_equal "test/test2", test2feat.path test3feat = BuildTool::Feature.new( "test3", testfeat ) assert_equal "test3", test3feat.name assert test3feat.active? assert_equal testfeat, test3feat.parent assert_equal "test/test3", test3feat.path # Check that disabling the parent feature disables the child feature testfeat.active = false assert !testfeat.active? assert !test3feat.active? end end