Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

51 lines (39 sloc) 1.546 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 KWBeKindOfClassMatcherTest : SenTestCase
@implementation KWBeKindOfClassMatcherTest
- (void)testItShouldHaveTheRightMatcherStrings {
NSArray *matcherStrings = [KWBeKindOfClassMatcher matcherStrings];
NSArray *expectedStrings = @[@"beKindOfClass:"];
STAssertEqualObjects([matcherStrings sortedArrayUsingSelector:@selector(compare:)],
[expectedStrings sortedArrayUsingSelector:@selector(compare:)],
@"expected specific matcher strings");
- (void)testItShouldMatchKindOfClass {
id subject = [Cruiser cruiser];
id matcher = [KWBeKindOfClassMatcher matcherWithSubject:subject];
[matcher beKindOfClass:[SpaceShip class]];
STAssertTrue([matcher evaluate], @"expected positive match");
- (void)testItShouldNotMatchNonKindOfClass {
id subject = [Cruiser cruiser];
id matcher = [KWBeKindOfClassMatcher matcherWithSubject:subject];
[matcher beKindOfClass:[Fighter class]];
STAssertFalse([matcher evaluate], @"expected negative match");
- (void)testItShouldHaveHumanReadableDescription
id matcher = [KWBeKindOfClassMatcher matcherWithSubject:nil];
[matcher beKindOfClass:[Fighter class]];
STAssertEqualObjects(@"be kind of Fighter", [matcher description], @"description should match");
#endif // #if KW_TESTS_ENABLED
Jump to Line
Something went wrong with that request. Please try again.