What is the status of SUnit in Pharo?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

What is the status of SUnit in Pharo?

Tim Mackinnon
Hi guys - what’s the status of SUnit in Pharo, are fixes supposed to be applied upstream to some master SUnit project or do we propose fixes/improvements locally?

For example the method:

should: aBlock raise: anExceptionalEvent whoseDescriptionIncludes: substring description: aString
        ^self assert: (self executeShould: aBlock inScopeOf: anExceptionalEvent withDescriptionContaining: substring)
                description: aString

The #executeShould:…. Is implemented in the subclass TestCase and not TestAsserter (is that a local pharo thing to do with Traits?) - the code critic shows an error - and it seems the Calypso doesn’t have an option to call these things out anymore?

But equally poking more - while I REALLY LOVE the fact that assert:equals: give me a useful diff browser on a failure - I REALLY HATE that there are many other examples where I don’t get the same useful UI - e.g.  #should:raise:whoseDescriptionIncludes:description: is awful????

Given our community mostly invented unit testing - why is it so poorly fleshed out to do the right thing?

Along the same lines - when trying to write descriptive tests, why can’t I easily assert the existence of a substring in something and get an equally useful message? I recall mentioning this a few years ago and don’t remember why I got shot down - but honestly, this stops us writing helpful tests and keeps us in the stone ages?

Can we modernise this state of affairs so things are like the amazing diff browser (which I’m assuming is some sort of hack? Is the debug window pulling apart a TestResult to do this - am interested in how it does this, as I couldn’t figure it out?)

Tim