diff --git a/dev/src/ExercismTools/ExercismExercise.class.st b/dev/src/ExercismTools/ExercismExercise.class.st index 8cab4da6..d3cdc27c 100644 --- a/dev/src/ExercismTools/ExercismExercise.class.st +++ b/dev/src/ExercismTools/ExercismExercise.class.st @@ -314,12 +314,17 @@ ExercismExercise >> printOn: aStream [ ExercismExercise >> removeDefinedSolutionClassesAndExtensionMethods [ "Defined Solution classes with implemented solution to be removed - utilized by TestRunner before importing student solution. DO NOT ERASE SYSTEM CLASSES. Only extension methods of them." - |exercisePackage| + |exercisePackage methodsToRemove| exercisePackage := self exercisePackageContainer. - self definedSolutionClasses do: [:aClass | exercisePackage removeClassNamed: aClass name]. + self definedSolutionClasses do: [:aClass | + exercisePackage removeClassNamed: aClass name. + aClass removeFromSystem + ]. "remove extension methods as well" - exercisePackage removeMethods: exercisePackage extensionMethods. + methodsToRemove := exercisePackage extensionMethods. + exercisePackage removeMethods: methodsToRemove. + methodsToRemove do: #removeFromSystem ]