Test expectation language (was Re: [squeak-dev] The Inbox: CollectionsTests-dtl.209.mcz)

Frank Shearar frank.shearar at gmail.com
Sat Jan 4 17:04:45 UTC 2014


On 4 January 2014 14:04, Sean P. DeNigris <sean at clipperadams.com> wrote:
> Frank Shearar-3 wrote
>> I don't like the "self" part of "self assert: a equals: b" just because
>> it doesn't add any information
>
> Wow, I thought *I* was a perfectionist… All that to eliminate the word
> "self" ;) If you really can't stand the "self", why not make It a class
> variable of TestCase? Then you can name the class something reasonable
> without sending a message.

It's one of the few things I actually _like_ about Ruby, that RSpec
has such a nice DSL. I'm not a huge fan of Cucumber (it's possible the
next few months will either make me hate or love it yet: it's in heavy
use at my new job), so I'm not talking about a language completely
different to the host language. It's just that, sometimes, like here,
I miss Ruby's implicit receivers.

But as Colin points out, using something like It is a bit "uncanny
valley". 'It' is close enough to English that the difference between
It and English is annoying. I suppose one could have `Assert that: a
equals: b`.

I don't know that it's worth writing yet another testing DSL, given
SUnit and Phexample already.

frank


More information about the Squeak-dev mailing list