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.56 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 KWBeMemberOfClassMatcherTest : SenTestCase
@implementation KWBeMemberOfClassMatcherTest
- (void)testItShouldHaveTheRightMatcherStrings {
NSArray *matcherStrings = [KWBeMemberOfClassMatcher matcherStrings];
NSArray *expectedStrings = [NSArray arrayWithObject:@"beMemberOfClass:"];
STAssertEqualObjects([matcherStrings sortedArrayUsingSelector:@selector(compare:)],
[expectedStrings sortedArrayUsingSelector:@selector(compare:)],
@"expected specific matcher strings");
- (void)testItShouldMatchMembersOfAClass {
id subject = [Cruiser cruiser];
id matcher = [KWBeMemberOfClassMatcher matcherWithSubject:subject];
[matcher beMemberOfClass:[Cruiser class]];
STAssertTrue([matcher evaluate], @"expected positive match");
- (void)testItShouldNotMatchNonMembersOfAClass {
id subject = [Cruiser cruiser];
id matcher = [KWBeMemberOfClassMatcher matcherWithSubject:subject];
[matcher beMemberOfClass:[Fighter class]];
STAssertFalse([matcher evaluate], @"expected negative match");
- (void)testItShouldHaveHumanReadableDescription
id matcher = [KWBeMemberOfClassMatcher matcherWithSubject:nil];
[matcher beMemberOfClass:[Cruiser class]];
STAssertEqualObjects(@"be member of Cruiser", [matcher description], @"description should match");
#endif // #if KW_TESTS_ENABLED
Jump to Line
Something went wrong with that request. Please try again.