[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

assert_false

aidy

9/26/2006 1:20:00 PM

Hi,

Does anyone know why assert_false is not inlcuded in Test:Unit, but for
e.g. assertFalse( ) is a method in JUnit?

aidy

2 Answers

David Holroyd

9/26/2006 4:11:00 PM

0

On Wed, Sep 27, 2006 at 12:09:24AM +0900, Jason Roelofs wrote:
> On 9/26/06, aidy <aidy.rutter@gmail.com> wrote:
> >
> >Hi,
> >
> >Does anyone know why assert_false is not inlcuded in Test:Unit, but for
> >e.g. assertFalse( ) is a method in JUnit?
>
> The same reason there's no assert_true? It's redundant, IMO.
>
> assert truth
> assert !truth
> assert (not truth)

Yet Ruby has both 'if' and 'unless' keywords.

I think it wuld be nice if the inverted version of the Assertions
methods were named 'deny', e.g. deny_nil vs. assert_not_nil. ;)


ta,
dave

--
http://david.holr...

MonkeeSage

9/27/2006 1:07:00 AM

0

aidy wrote:
> Hi,
>
> Does anyone know why assert_false is not inlcuded in Test:Unit, but for
> e.g. assertFalse( ) is a method in JUnit?

Hi aidy,

Have a look at the source of <path to your ruby
libs>/1.8/test/unit/assertions.rb and search for the text: "Example
Custom Assertion".

Regards,
Jordan