Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

62 lines (50 sloc) 1.841 kb
//
// KWUserDefinedMatcher.h
// Kiwi
//
// Created by Luke Redpath on 16/06/2011.
// Copyright 2011 Allen Ding. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "KWMatcher.h"
typedef BOOL (^KWUserDefinedMatcherBlock)();
@interface KWUserDefinedMatcher : KWMatcher
{
KWUserDefinedMatcherBlock matcherBlock;
SEL selector;
NSInvocation *invocation;
NSString *failureMessageForShould;
NSString *failureMessageForShouldNot;
}
@property (nonatomic, assign) SEL selector;
@property (nonatomic, copy) NSString *failureMessageForShould;
@property (nonatomic, copy) NSString *failureMessageForShouldNot;
@property (nonatomic, assign) KWUserDefinedMatcherBlock matcherBlock;
@property (nonatomic, copy) NSString *description;
+ (id)matcherWithSubject:(id)aSubject block:(KWUserDefinedMatcherBlock)aBlock;
- (id)initWithSubject:(id)aSubject block:(KWUserDefinedMatcherBlock)aBlock;
- (void)setSubject:(id)aSubject;
@end
#pragma mark -
typedef NSString * (^KWUserDefinedMatcherMessageBlock)(id);
@interface KWUserDefinedMatcherBuilder : NSObject
{
KWUserDefinedMatcher *matcher;
KWUserDefinedMatcherMessageBlock failureMessageForShouldBlock;
KWUserDefinedMatcherMessageBlock failureMessageForShouldNotBlock;
NSString *description;
}
@property (nonatomic, readonly) NSString *key;
+ (id)builder;
+ (id)builderForSelector:(SEL)aSelector;
- (id)initWithSelector:(SEL)aSelector;
#pragma mark -
#pragma mark Configuring The Matcher
- (void)match:(KWUserDefinedMatcherBlock)block;
- (void)failureMessageForShould:(KWUserDefinedMatcherMessageBlock)block;
- (void)failureMessageForShouldNot:(KWUserDefinedMatcherMessageBlock)block;
- (void)description:(NSString *)description;
#pragma mark -
#pragma mark Buiding The Matcher
- (KWUserDefinedMatcher *)buildMatcherWithSubject:(id)subject;
@end
Jump to Line
Something went wrong with that request. Please try again.