\ntestDescription(<<end);\nThis test checks that widgets can mate with thingamaboobs\nend\n\n\ntestStep("create a gray widget");\n...\ntestStep("create a red thigamaboob");\n...\ntestStep("mate the widget and the thigamaboob");\n...\ntestStep("verify that the result is gray with red stripes");\n\n
In my previous implementation, I used the following
\ntestDescription(<<end);\nThis test checks that widgets can mate with thingamaboobs\n\n- create a gray widget\n- create a red thigamaboob\n- mate the widget and the thigamaboob\n- verify that the result is gray with red stripes\n\nend\n\n\ntestStep();\n...\ntestStep();\n...\ntestStep();\n...\ntestStep();\n
The test support code would parse a bunc hof " - xxx" at the end of test descrioption, and use them to notify the user of test step being taken.
That, of course, was quite fragile. More importantly, the self-documenting value of testStep was completely lost.
So the question is - how do I extract the test steps from the code? I was thinking about using compilation pass. Now that I look at it again - it seems that I could open the script file from inside testDescription, and grep for testStep() - God forgive me.