Indenting code between test.StartTest and test.stopTest
Issue #612
resolved
I know, get over it right?
Have not found a way to do this:
test.startTest(); //Code here //More Code here test.stopTest();
Instead it does this (which is harder to read)
test.startTest(); //Code here //More Code here test.stopTest();
Is there a way to add an indent to all code between the start and stop test?
Comments (3)
-
repo owner -
reporter @RoseSilverSoftware Well nuts. never even thought of doing the {}. Feel free to close this as that will do exactly what I wanted
-
repo owner - changed status to resolved
Your wish is my command.
- Log in to comment
Hah! Technically that doesn't define a lexical scope, so the purist in me is inclined to push back. In fact, what I'd be inclined to say is that you should do the following (and I know many people who do):
The downside of that is that anything declared in the test block will not be available after the test block, though it's arguable that you can and should query it for test results validation.
Let me chew on this one. There's no technical hurdle here, but it's just contrary to the typical way that indentation follows lexical scoping.