lib/test/unit/testcase.rb in test-unit-2.4.3 vs lib/test/unit/testcase.rb in test-unit-2.4.4

- old
+ new

@@ -1,11 +1,11 @@ #-- # # Author:: Nathaniel Talbott. # Copyright:: # * Copyright (c) 2000-2003 Nathaniel Talbott. All rights reserved. -# * Copyright (c) 2008-2011 Kouhei Sutou <tt><kou@clear-code.com></tt> +# * Copyright (c) 2008-2012 Kouhei Sutou <tt><kou@clear-code.com></tt> # License:: Ruby license. require 'test/unit/attribute' require 'test/unit/fixture' require 'test/unit/exceptionhandler' @@ -358,24 +358,34 @@ # setup # def my_setup1 # ... # end # + # setup do + # ... # setup callback1 + # end + # # setup # def my_setup2 # ... # end # + # setup do + # ... # setup callback2 + # end + # # def test_my_class # ... # end # end # # Here is a call order: # * setup # * my_setup1 + # * setup callback1 # * my_setup2 + # * setup callback2 # * test_my_class def setup end # Called after every test method runs but the test @@ -393,23 +403,33 @@ # cleanup # def my_cleanup1 # ... # end # + # cleanup do + # ... # cleanup callback1 + # end + # # cleanup # def my_cleanup2 # ... # end # + # cleanup do + # ... # cleanup callback2 + # end + # # def test_my_class # ... # end # end # # Here is a call order: # * test_my_class + # * cleanup callback2 # * my_cleanup2 + # * cleanup callback1 # * my_cleanup1 # * cleanup def cleanup end @@ -426,22 +446,32 @@ # teardown # def my_teardown1 # ... # end # + # teardown do + # ... # teardown callback1 + # end + # # teardown # def my_teardown2 # ... # end # + # teardown do + # ... # teardown callback2 + # end + # # def test_my_class # ... # end # end # # Here is a call order: # * test_my_class + # * teardown callback2 # * my_teardown2 + # * teardown callback1 # * my_teardown1 # * teardown def teardown end