Creating temporary classes for testing

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Creating temporary classes for testing

Sean P. DeNigris
Administrator
I was playing with creating temporary classes for testing in a separate SystemDictionary, so I don't have to worry about removing them.  But I'm a little beyond the boundary of my knowledge (although I stepped through it in the debugger and it seemed pretty straight forward).  Are there any hidden side-effects/implications of the following?  Specifically, after the SystemDictionary is garbage collected, is the system exactly the same as it was before the code was run:

  testingEnvironment := SystemDictionary new.

  ClassBuilder new
        name: #AClassForTesting
        inEnvironment: testingEnvironment
        subclassOf: Object
        type: Object typeOfClass
        instanceVariableNames: ''
        classVariableNames: ''
        poolDictionaries: ''
        category: 'TemporaryTesting'.

  morph := (testingEnvironment at: #AClassForTesting) asMorph openInWorld.
  morph delete.

Thanks.
Sean
Cheers,
Sean