Norbert Hartl wrote:
I use Sunit + Phexample in my project. The model uses a dynamic variable. In order to ease the writing of tests I implemented in my TestCase
IAMModelTests>>#runCase
self createContext do: [ super runCase ]
with
IAMContext>>#do: aBlock ^ IAMCurrentContext value: self during: aBlock
It works basically. The method #runCase is only execute once. The #given: calls inside a test method do not trigger further runCase executions. The strange thing is that all tests succeed when I run them alone e.g. in Nautilus. Whenever I run the tests via the testrunner 2 tests fail. Those 2 tests are not any more special than the other tests. And they fail reliably.
Does anyone has a hint what is different when being run in testrunner. I cannot debug the problem easily because then I would run the test alone and it will succeed.
thanks,
Norbert
I don't know what might be different, but maybe a way to attack it is to put a halt in a test method. Then look down the debugger stack and remove "on: self class failure , self class skip, Warning, self class error" from TestCase>>runCase: Now you'll get a debugger at the moment the failure occurs, rather than filing it to be later clicked on to run it by itself. cheers -ben