From: luke gruber Date: 2011-08-10T06:16:50+09:00 Subject: Re: MiniTest before and after all >Thomas Sawyer wrote in post #1015734: > What is the conventional thinking on this topic? Maybe I'm wrong but I was going through some Ruby standard libraries just the other day and I saw this: ## # Define a 'before' action. Inherits the way normal methods should. # # NOTE: +type+ is ignored and is only there to make porting easier. # # Equivalent to MiniTest::Unit::TestCase#setup. def self.before type = :each, &block raise "unsupported before type: #{type}" unless type == :each define_inheritable_method :setup, &block end ## # Define an 'after' action. Inherits the way normal methods should. # # NOTE: +type+ is ignored and is only there to make porting easier. # # Equivalent to MiniTest::Unit::TestCase#teardown. def self.after type = :each, &block raise "unsupported after type: #{type}" unless type == :each define_inheritable_method :teardown, &block end Keep in mind I don't use minitest so that might not be what you're after. -Luke -- Posted via http://www.ruby-forum.com/.