On 02.04.2006, at 16:08, Brent Pinkney wrote:
Hi,
* TestCase>>should: aBlock notTakeMoreThanMilliseconds: anInteger
Would it not be nicer to implement this using ANSI Durations rather then milliseconds ? Something akin to #valueWithin:onTimeout:
Yes, I think phillipe suggested the same... let's do it.
My suggestion would be
self assert: [ x doSomething ] within: 5 seconds.
hmm... assert: allways takes an expression, should: takes a block in SUnit. (the standard Object>>#assert: can have both a bock and a expression).
So for Sunit, it would be something like:
self shouldnt: [1 + 2] takeMoreThan: 3 seconds or
self should: [1 + 2] takeNoMoreThan: 3 seconds
or, we could make change TestCase assert: to be like Object>>#assert: and provide
TestCase>>#assert: [ x doSomething ] within: 5 seconds.
Or just both? having TestCase>>#assert: to be the same semantics like Objects>>assert: definitly makes sense...
Marcus