From: Raymond O'Connor Date: 2009-12-10T13:33:58+09:00 Subject: Chain Method in Class with Method in Module I'd like to chain setup in a unit test, so that it calls a method in a module BEFORE running through the setup code. I'd like to do it without having to put super() in the test's setup method. module MyModule module InstanceMethods def setup puts 'module setup' end end def self.included(base) base.send :include, InstanceMethods end end class MyUnitTest < Test::Unit::TestCase include MyModule def setup puts 'class setup' end end If this were working when I run a test in MyUnitTest it should print out module setup class setup Unfortunately I can't get it to work. Even with alias_method, I run into problems it seems because the class setup is defined after the module is included. Anyone one have any ideas? Thanks! -- Posted via http://www.ruby-forum.com/.