Permalink
Browse files

Added test for `-[NSArray firstObject]` category #90

This should return nil if the array is empty.
  • Loading branch information...
1 parent a4353ba commit 0a58bda7938ad5a985fa27e92d135ac1b18054fc @soffes soffes committed Sep 26, 2011
Showing with 4 additions and 0 deletions.
  1. +4 −0 Tests/ArrayCategoryTest.m
@@ -21,6 +21,10 @@ - (void)testFirstObject {
NSArray *array = [[NSArray alloc] initWithObjects:@"foo", @"bar", nil];
GHAssertEqualObjects([array firstObject], @"foo", nil);
[array release];
+
+ array = [[NSArray alloc] init];
+ GHAssertNil([array firstObject], nil);
+ [array release];
}

0 comments on commit 0a58bda

Please sign in to comment.