I like Travis Griggs' SUnitToo package and the corresponding browser extension ExtraRBForSUnitToo. One thing I always disliked about SUnit in general, though, is that you had to name your test methods to start with the word "test". This means that if you want to remove a test from the test suite for some reason, you have to rename it.
So, I decided to take the bull by the horns and do something about it. First, I created a new pragma for subclasses of TestCase.
TestCase class:
testPragmas
<pragmas: #instance>
^#(#test)
Now, we can test for the attribute #test to determine if methods are testcases. To do this, we need to change a few methods.
TestCase class:
testSelectors
^self selectors select: [:each |
('test*' match: each) or:
[(self findSelector: each) last attributes
ifNil: [false]
ifNotNil: [:attributes | attributes includesKey: #test]]]
TestCase class:
allTestSelectors
^self allSelectors select: [:each | ('test*' match: each) or:
[(self findSelector: each) last attributes
ifNil: [false]
ifNotNil: [:attributes | attributes includesKey: #test]]]
CompiledMethod:
isTestCaseMethod
^(self mclass inheritsFrom: SUnit.TestCase)
and: [('test*' match: self selector) or:
[(self mclass findSelector: self selector) last attributes
ifNil: [false]
ifNotNil: [:attributes | attributes includesKey: #test]]]
That's it. Now, you can write a testcase with a normal method name. To mark it as a testcase, you just add a <test> pragma to the method.
MyTestClass
openConnectionAndSendMessage
<test>
"...code for the test..."
I'd be happy to submit these changes to the Cincom public Store repository if there's interest.