Permalink
Browse files

Added more descriptive error messages to -assertTrue: -assertFalse: -…

…assertNull: and -assertNotNull:
  • Loading branch information...
1 parent 05f8e3e commit ad1f6d742278a633eb7434bcb20e1946951a5313 Martin Häcker committed with Ross Boucher May 15, 2009
Showing with 4 additions and 4 deletions.
  1. +4 −4 OJTestCase.j
View
@@ -72,7 +72,7 @@ AssertionFailedError = "AssertionFailedError";
- (void)assertTrue:(BOOL)condition
{
- [self assertTrue:condition message:nil];
+ [self assertTrue:condition message:"expected YES but got NO"];
}
- (void)assertTrue:(BOOL)condition message:(CPString)message
{
@@ -82,7 +82,7 @@ AssertionFailedError = "AssertionFailedError";
- (void)assertFalse:(BOOL)condition
{
- [self assertFalse:condition message:nil];
+ [self assertFalse:condition message:"expecteed NO but gut YES"];
}
- (void)assertFalse:(BOOL)condition message:(CPString)message
{
@@ -121,7 +121,7 @@ AssertionFailedError = "AssertionFailedError";
- (void)assertNull:(id)object
{
- [self assertNull:object message:nil];
+ [self assertNull:object message:"expected null but got " + object];
}
- (void)assertNull:(id)object message:(CPString)message
{
@@ -130,7 +130,7 @@ AssertionFailedError = "AssertionFailedError";
- (void)assertNotNull:(id)object
{
- [self assertNotNull:object message:nil];
+ [self assertNotNull:object message:"expected an object but got null"];
}
- (void)assertNotNull:(id)object message:(CPString)message
{

0 comments on commit ad1f6d7

Please sign in to comment.