From: Jean Privat Date: Wed, 16 Dec 2015 17:12:22 +0000 (-0500) Subject: Merge: niunit: fix after/before test calls X-Git-Tag: v0.8~35 X-Git-Url: http://nitlanguage.org Merge: niunit: fix after/before test calls The specification of `nitunit` states that before and after methods can be called to initialize or clean test related things: ~~~nit module my_test_suite class MyTestSuite super TestSuite redef fun before_test do # complex things to set up the test end redef fun after_test do # complex things to tear down the test end fun test_foo do end fun test_bar do end end ~~~ In the above example, `nitunit` will call the methods precisely in this order: ~~~nit test_before test_foo test_after test_before test_bar test_after ~~~ Before this PR, the before and after methods were only call if a redefinition of the before/after method exists locally in the test suite. Inheritance was not considered: ~~~nit module my_test_suite class TestBase super TestSuite redef fun before_test do # ... redef fun after_test do # ... end class MyTestSuite super TestBase fun test_foo do end fun test_bar do end end ~~~ So the output was only: ~~~nit test_foo test_bar ~~~ This PR fixes that behavior. Pull-Request: #1897 Reviewed-by: Jean Privat --- e47f39f90453a104323b7e7cca8f9627d77a77fe