Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

51 lines (38 sloc) 1.47 KB
// Licensed under the terms in License.txt
// Copyright 2010 Allen Ding. All rights reserved.
#import "Kiwi.h"
#import "KiwiTestConfiguration.h"
#import "TestClasses.h"
@interface KWEmptyCollectionMatcherTest : SenTestCase
@implementation KWEmptyCollectionMatcherTest
- (void)testItShouldHaveTheRightMatcherStrings {
NSArray *matcherStrings = [KWBeEmptyMatcher matcherStrings];
NSArray *expectedStrings = [NSArray arrayWithObject:@"beEmpty"];
STAssertEqualObjects([matcherStrings sortedArrayUsingSelector:@selector(compare:)],
[expectedStrings sortedArrayUsingSelector:@selector(compare:)],
@"expected specific matcher strings");
- (void)testItShouldMatchEmptyCollections {
id subject = [NSDictionary dictionary];
id matcher = [KWBeEmptyMatcher matcherWithSubject:subject];
[matcher beEmpty];
STAssertTrue([matcher evaluate], @"expected positive match");
- (void)testItShouldNotMatchNonEmptyCollections {
id subject = [NSDictionary dictionaryWithObject:@"bar" forKey:@"foo"];
id matcher = [KWBeEmptyMatcher matcherWithSubject:subject];
[matcher beEmpty];
STAssertFalse([matcher evaluate], @"expected negative match");
- (void)testItShouldHaveHumanReadableDescription
id matcher = [KWBeEmptyMatcher matcherWithSubject:nil];
STAssertEqualObjects(@"be empty", [matcher description], @"description should match");
#endif // #if KW_TESTS_ENABLED
Jump to Line
Something went wrong with that request. Please try again.