assert_false

A

aidy

Hi,

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

aidy
 
D

David Holroyd

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
 
M

MonkeeSage

aidy said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,214
Messages
2,571,110
Members
47,702
Latest member
gancflex

Latest Threads

Top