Boost logo

Boost :

From: Rene Rivera (grafikrobot_at_[hidden])
Date: 2006-09-17 23:37:52


Dean Michael Berris wrote:
> On 9/17/06, Joel de Guzman <joel_at_[hidden]> wrote:

>> Anyway, I should assert (pardon the pun ;) ) that behavior
>> specification in code (as a DSEL?) is an illusion. People
>> would tend to believe that with it, you can specify a program
>> behavior and get away with no documentation. Proof in point:
>> Richard Newman's post (unless I misunderstood him). That makes
>> me worry.
>
> It's a bit of a stretch, but I think the BDD interface to
> specification as opposed to the Assert methods for TDD are mere
> alternatives to each other.

Alternatives just tend to confuse things more than help.

> Because:
>
> ASSERT_EQUAL(a, 10)
>
> Is pretty much tantamount and equivalent to:
>
> value(a).should.equal(10);
>
> It's a case of "Tomaytoe" "Tomahtoe" :-D

True. But neither of those is more readable to the likely person writing
  the specs/tests than:

test( a == 10 );

Yes I keep changing the function name, I used "ensure" and someone
replied that it was the same as "assert". And yes, that's my point. It's
a mechanism that programmers are already familiar with, and comes
naturally to them. So why rewrite it into a less capable form?

I have another simple question; Does Ruby have the equivalent of assert?

-- 
-- Grafik - Don't Assume Anything
-- Redshift Software, Inc. - http://redshift-software.com
-- rrivera/acm.org - grafik/redshift-software.com
-- 102708583/icq - grafikrobot/aim - grafikrobot/yahoo

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk