Changeset 232
- Timestamp:
- 06/12/05 09:37:25 (3 years ago)
- Location:
- trunk
- Files:
-
- 2 modified
-
lib/fm/composedobject.rb (modified) (2 diffs)
-
tests/composedobject.tests.rb (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/fm/composedobject.rb
r212 r232 200 200 # SVN Id 201 201 SVNId = %q$Id$ 202 203 # SVN URL204 SVNURL = %q$URL$205 202 206 203 # The factor which is applied to traits' modifiers in the calculation of … … 368 365 369 366 self.traitMap[ name ] = constituents 370 eval( self::buildTraitMethods(name, *constituents), nil, __FILE__, __LINE__ ) 367 code = self::buildTraitMethods( name, *constituents ) 368 369 module_eval( code ) 371 370 end 372 371 -
trunk/tests/composedobject.tests.rb
r212 r232 4 4 # $Id$ 5 5 # 6 # Copyright (c) 2003, 2004 The FaerieMUD Consortium.6 # Copyright (c) 2003, 2004, 2005 The FaerieMUD Consortium. 7 7 # 8 8 … … 314 314 } 315 315 assert_respond_to testObj, :trait1, "Does not respond to trait1 accessor" 316 assert testClass::instance_methods(false).include?( "trait1" ), 317 "Trait method #trait1 should inhere in the subclass" 316 318 assert_respond_to testObj, :trait2, "Does not respond to trait2 accessor" 319 assert testClass::instance_methods(false).include?( "trait2" ), 320 "Trait method #trait2 should inhere in the subclass" 317 321 assert_respond_to testObj, :trait3, "Does not respond to trait3 accessor" 322 assert testClass::instance_methods(false).include?( "trait3" ), 323 "Trait method #trait3 should inhere in the subclass" 318 324 end 319 325 … … 360 366 } 361 367 assert_respond_to testObj, :trait1_2, "Does not respond to trait1_2 accessor" 368 assert testClass::instance_methods(false).include?( "trait1_2" ), 369 "Trait method #trait1_2 should inhere in the subclass" 362 370 assert_respond_to testObj, :trait2_3, "Does not respond to trait2_3 accessor" 371 assert testClass::instance_methods(false).include?( "trait2_3" ), 372 "Trait method #trait2_3 should inhere in the subclass" 363 373 assert_respond_to testObj, :trait3_1, "Does not respond to trait3_1 accessor" 374 assert testClass::instance_methods(false).include?( "trait3_1" ), 375 "Trait method #trait3_1 should inhere in the subclass" 364 376 assert_respond_to testObj, :trait2_1, "Does not respond to trait2_1 accessor" 377 assert testClass::instance_methods(false).include?( "trait2_1" ), 378 "Trait method #trait2_1 should inhere in the subclass" 365 379 assert_respond_to testObj, :trait3_2, "Does not respond to trait3_2 accessor" 380 assert testClass::instance_methods(false).include?( "trait3_2" ), 381 "Trait method #trait3_2 should inhere in the subclass" 366 382 assert_respond_to testObj, :trait1_3, "Does not respond to trait1_3 accessor" 383 assert testClass::instance_methods(false).include?( "trait1_3" ), 384 "Trait method #trait1_3 should inhere in the subclass" 367 385 end 368 386 … … 406 424 } 407 425 assert_respond_to testObj, :trait1_2_3, "Does not respond to trait1_2_3 accessor" 426 assert testClass::instance_methods(false).include?( "trait1_2_3" ), 427 "Trait method #trait1_2_3 should inhere in the subclass" 408 428 assert_respond_to testObj, :trait2_3_1, "Does not respond to trait2_3_1 accessor" 429 assert testClass::instance_methods(false).include?( "trait2_3_1" ), 430 "Trait method #trait2_3_1 should inhere in the subclass" 409 431 assert_respond_to testObj, :trait3_1_2, "Does not respond to trait3_1_2 accessor" 432 assert testClass::instance_methods(false).include?( "trait3_1_2" ), 433 "Trait method #trait3_1_2 should inhere in the subclass" 410 434 411 435 self.class.addSetupBlock {
