Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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

…assertNull: and -assertNotNull:
  • Loading branch information...
commit ad1f6d742278a633eb7434bcb20e1946951a5313 1 parent 05f8e3e
Martin Häcker authored Ross Boucher committed
Showing with 4 additions and 4 deletions.
  1. +4 −4 OJTestCase.j
View
8 OJTestCase.j
@@ -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
{
Please sign in to comment.
Something went wrong with that request. Please try again.