From 1994163e1d0aeb8c2e04c4acfba1c02f303acf21 Mon Sep 17 00:00:00 2001 From: Alexandre Terrasa Date: Fri, 3 Feb 2017 01:52:33 -0500 Subject: [PATCH] testing: fix `before_module` and `after_module` method recognition Signed-off-by: Alexandre Terrasa --- src/testing/testing_suite.nit | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/testing/testing_suite.nit b/src/testing/testing_suite.nit index a350210..dc29ea5 100644 --- a/src/testing/testing_suite.nit +++ b/src/testing/testing_suite.nit @@ -344,10 +344,10 @@ redef class MMethodDef private fun is_test: Bool do return name.has_prefix("test_") # Is the method a "before_module"? - private fun is_before_module: Bool do return mproperty.is_toplevel and name == "before_module" + private fun is_before_module: Bool do return name == "before_module" # Is the method a "after_module"? - private fun is_after_module: Bool do return mproperty.is_toplevel and name == "after_module" + private fun is_after_module: Bool do return name == "after_module" end redef class MClassDef @@ -367,7 +367,7 @@ redef class MModule # "before_module" method for this module. private fun before_test: nullable MMethodDef do for mclassdef in mclassdefs do - if not mclassdef.name == "Object" then continue + if not mclassdef.name == "Sys" then continue for mpropdef in mclassdef.mpropdefs do if mpropdef isa MMethodDef and mpropdef.is_before_module then return mpropdef end @@ -378,7 +378,7 @@ redef class MModule # "after_module" method for this module. private fun after_test: nullable MMethodDef do for mclassdef in mclassdefs do - if not mclassdef.name == "Object" then continue + if not mclassdef.name == "Sys" then continue for mpropdef in mclassdef.mpropdefs do if mpropdef isa MMethodDef and mpropdef.is_after_module then return mpropdef end -- 1.7.9.5