Sven Van Caekenberghe wrote:
self assert: (file species isKindOf: FileStream)
But that is a weird test. What is the point ?
You have to test behaviour, like write a file and see if it was written.
Testing types is very seldom done, because this is an implementation detail.
Thanks Sheri and Sven. I learnt a new aspect of design philosophy today.
Thats one thing I like about contributing to open source - the
opportunity for learning, especially from the questions that other
people ask.
cheers -ben
On 04 Dec 2014, at 01:32, [email protected] wrote:
Hi there,
I have a failing test and was wondering if anyone would have a sense as to why:
| testString filename file |
testString := 'ascii String'.
filename := 'test-file-' , 99 atRandom printString , '.txt'.
filename asFileReference ensureDelete.
file := filename asFileReference
writeStreamDo: [ :stream |
stream
nextPutAll: testString;
crlf ].
self assert: file species = FileStream.
Many thanks,
Sheri
Step into #writeStreamDo: ...