From: Intransition Date: 2011-08-10T15:26:16+09:00 Subject: Re: MiniTest before and after all On Aug 9, 5:16 pm, luke gruber wrote: > >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. That's just elucidating my question. Read the line: raise "unsupported before type: #{type}" unless type == :each I'm asking about `:all`,