Squeak-dev Digest, Vol 22, Issue 20

Marcus Denker denker at iam.unibe.ch
Fri Oct 15 23:30:37 UTC 2004


Am 16.10.2004 um 01:12 schrieb Andreas Nilsson:

> In my experience it really does take longer to go from a failed unit 
> test to implementing a missing method

In Squeak, it's really fast to add a missing method at runtime: The 
pre-debug window (that red thingy) has a
"create" button.

Try it!

first we make a new class for test:

TestCase subclass: #MyTest
	instanceVariableNames: ''
	classVariableNames: ''
	poolDictionaries: ''
	category: 'System-Support-Tests'

Now start up the TestRunner and select the Test. "Run once". green. 
nice.

Then we implement a method:

testHallo
	self assert: MyClass new example = 16.

Accept. The System does not now about "MyClass", so it asks you what to 
do. Select "define class".

Now run the test again. It will be red. so klick on the error. Debugger 
popps up. select "create"
Select MyClass, select "accessing".

Second debugger. Click "debug" select third from top ("example"). This 
now looks like:

example
	self shouldBeImplemented

replace that with:

example
	^ 4 squared.

click procees. run test again --> green.





More information about the Squeak-dev mailing list