-
Notifications
You must be signed in to change notification settings - Fork 118
/
HCDescribedAs.h
50 lines (37 loc) · 1.46 KB
/
HCDescribedAs.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
//
// OCHamcrest - HCDescribedAs.h
// Copyright 2012 hamcrest.org. See LICENSE.txt
//
// Created by: Jon Reid, http://qualitycoding.org/
// Docs: http://hamcrest.github.com/OCHamcrest/
// Source: https://github.com/hamcrest/OCHamcrest
//
#import <OCHamcrest/HCBaseMatcher.h>
@interface HCDescribedAs : HCBaseMatcher
{
NSString *descriptionTemplate;
id<HCMatcher> matcher;
NSArray *values;
}
+ (id)describedAs:(NSString *)description
forMatcher:(id<HCMatcher>)aMatcher
overValues:(NSArray *)templateValues;
- (id)initWithDescription:(NSString *)description
forMatcher:(id<HCMatcher>)aMatcher
overValues:(NSArray *)templateValues;
@end
OBJC_EXPORT id<HCMatcher> HC_describedAs(NSString *description, id<HCMatcher> matcher, ...) NS_REQUIRES_NIL_TERMINATION;
/**
describedAs(description, matcher, ...) -
Adds custom failure description to a given matcher.
@param description Overrides the matcher's description.
@param matcher,... The matcher to satisfy, followed by a comma-separated list of substitution values ending with @c nil.
The description may contain substitution placeholders \%0, \%1, etc. These will be replaced by
any values that follow the matcher.
(In the event of a name clash, don't \#define @c HC_SHORTHAND and use the synonym
@c HC_describedAs instead.)
@ingroup decorator_matchers
*/
#ifdef HC_SHORTHAND
#define describedAs HC_describedAs
#endif