Skip to content
This repository was archived by the owner on May 2, 2021. It is now read-only.

Commit 0232cb1

Browse files
author
Tae Won Ha
committed
Merge branch 'issue-10' (fixing #19, #20)
2 parents c7ccc15 + 156c6e2 commit 0232cb1

File tree

148 files changed

+8192
-3151
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

148 files changed

+8192
-3151
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Versions/Current/Headers
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Versions/Current/OCHamcrest
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Versions/Current/Resources
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
//
2+
// OCHamcrest - HCAllOf.h
3+
// Copyright 2013 hamcrest.org. See LICENSE.txt
4+
//
5+
// Created by: Jon Reid, http://qualitycoding.org/
6+
// Docs: http://hamcrest.github.com/OCHamcrest/
7+
// Source: https://github.com/hamcrest/OCHamcrest
8+
//
9+
10+
#import <OCHamcrest/HCBaseMatcher.h>
11+
12+
13+
@interface HCAllOf : HCBaseMatcher
14+
{
15+
NSArray *matchers;
16+
}
17+
18+
+ (instancetype)allOf:(NSArray *)theMatchers;
19+
- (instancetype)initWithMatchers:(NSArray *)theMatchers;
20+
21+
@end
22+
23+
24+
OBJC_EXPORT id HC_allOf(id match, ...) NS_REQUIRES_NIL_TERMINATION;
25+
26+
/**
27+
allOf(firstMatcher, ...) -
28+
Matches if all of the given matchers evaluate to @c YES.
29+
30+
@param firstMatcher,... A comma-separated list of matchers ending with @c nil.
31+
32+
The matchers are evaluated from left to right using short-circuit evaluation, so evaluation
33+
stops as soon as a matcher returns @c NO.
34+
35+
Any argument that is not a matcher is implicitly wrapped in an @ref equalTo matcher to check for
36+
equality.
37+
38+
(In the event of a name clash, don't \#define @c HC_SHORTHAND and use the synonym
39+
@c HC_allOf instead.)
40+
41+
@ingroup logical_matchers
42+
*/
43+
#ifdef HC_SHORTHAND
44+
#define allOf HC_allOf
45+
#endif
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
//
2+
// OCHamcrest - HCAnyOf.h
3+
// Copyright 2013 hamcrest.org. See LICENSE.txt
4+
//
5+
// Created by: Jon Reid, http://qualitycoding.org/
6+
// Docs: http://hamcrest.github.com/OCHamcrest/
7+
// Source: https://github.com/hamcrest/OCHamcrest
8+
//
9+
10+
#import <OCHamcrest/HCBaseMatcher.h>
11+
12+
13+
@interface HCAnyOf : HCBaseMatcher
14+
{
15+
NSArray *matchers;
16+
}
17+
18+
+ (instancetype)anyOf:(NSArray *)theMatchers;
19+
- (instancetype)initWithMatchers:(NSArray *)theMatchers;
20+
21+
@end
22+
23+
24+
OBJC_EXPORT id HC_anyOf(id match, ...) NS_REQUIRES_NIL_TERMINATION;
25+
26+
/**
27+
anyOf(firstMatcher, ...) -
28+
Matches if any of the given matchers evaluate to @c YES.
29+
30+
@param firstMatcher,... A comma-separated list of matchers ending with @c nil.
31+
32+
The matchers are evaluated from left to right using short-circuit evaluation, so evaluation
33+
stops as soon as a matcher returns @c YES.
34+
35+
Any argument that is not a matcher is implicitly wrapped in an @ref equalTo matcher to check for
36+
equality.
37+
38+
(In the event of a name clash, don't \#define @c HC_SHORTHAND and use the synonym
39+
@c HC_anyOf instead.)
40+
41+
@ingroup logical_matchers
42+
*/
43+
#ifdef HC_SHORTHAND
44+
#define anyOf HC_anyOf
45+
#endif
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
//
2+
// OCHamcrest - HCAssertThat.h
3+
// Copyright 2013 hamcrest.org. See LICENSE.txt
4+
//
5+
// Created by: Jon Reid, http://qualitycoding.org/
6+
// Docs: http://hamcrest.github.com/OCHamcrest/
7+
// Source: https://github.com/hamcrest/OCHamcrest
8+
//
9+
10+
#import <objc/objc-api.h>
11+
12+
@protocol HCMatcher;
13+
14+
15+
OBJC_EXPORT void HC_assertThatWithLocation(id testCase, id actual, id <HCMatcher> matcher,
16+
const char *fileName, int lineNumber);
17+
18+
#define HC_assertThat(actual, matcher) \
19+
HC_assertThatWithLocation(self, actual, matcher, __FILE__, __LINE__)
20+
21+
/**
22+
assertThat(actual, matcher) -
23+
Asserts that actual value satisfies matcher.
24+
25+
@param actual The object to evaluate as the actual value.
26+
@param matcher The matcher to satisfy as the expected condition.
27+
28+
@c assertThat passes the actual value to the matcher for evaluation. If the matcher is not
29+
satisfied, an exception is thrown describing the mismatch.
30+
31+
@c assertThat is designed to integrate well with OCUnit and other unit testing frameworks.
32+
Unmet assertions are reported as test failures. In Xcode, these failures can be clicked to
33+
reveal the line of the assertion.
34+
35+
In the event of a name clash, don't \#define @c HC_SHORTHAND and use the synonym
36+
@c HC_assertThat instead.
37+
38+
@ingroup integration
39+
*/
40+
#ifdef HC_SHORTHAND
41+
#define assertThat HC_assertThat
42+
#endif
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
//
2+
// OCHamcrest - HCBaseDescription.h
3+
// Copyright 2013 hamcrest.org. See LICENSE.txt
4+
//
5+
// Created by: Jon Reid, http://qualitycoding.org/
6+
// Docs: http://hamcrest.github.com/OCHamcrest/
7+
// Source: https://github.com/hamcrest/OCHamcrest
8+
//
9+
10+
#import <Foundation/Foundation.h>
11+
#import <OCHamcrest/HCDescription.h>
12+
13+
14+
/**
15+
Base class for all HCDescription implementations.
16+
17+
@ingroup core
18+
*/
19+
@interface HCBaseDescription : NSObject <HCDescription>
20+
@end
21+
22+
23+
/**
24+
Methods that must be provided by subclasses of HCBaseDescription.
25+
*/
26+
@interface HCBaseDescription (SubclassMustImplement)
27+
28+
/**
29+
Append the string @a str to the description.
30+
*/
31+
- (void)append:(NSString *)str;
32+
33+
@end
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
//
2+
// OCHamcrest - HCBaseMatcher.h
3+
// Copyright 2013 hamcrest.org. See LICENSE.txt
4+
//
5+
// Created by: Jon Reid, http://qualitycoding.org/
6+
// Docs: http://hamcrest.github.com/OCHamcrest/
7+
// Source: https://github.com/hamcrest/OCHamcrest
8+
//
9+
10+
#import <Foundation/Foundation.h>
11+
#import <OCHamcrest/HCMatcher.h>
12+
13+
#import <objc/objc-api.h> // Convenience header, to provide OBJC_EXPORT
14+
15+
16+
/**
17+
Base class for all HCMatcher implementations.
18+
19+
Most implementations can just implement @c -matches: and let
20+
<code>-matches:describingMismatchTo:</code> call it. But if it makes more sense to generate the
21+
mismatch description during the matching, override <code>-matches:describingMismatchTo:</code>
22+
and have @c -matches: call it with a @c nil description.
23+
24+
@ingroup core
25+
*/
26+
@interface HCBaseMatcher : NSObject <HCMatcher>
27+
@end
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
//
2+
// OCHamcrest - HCClassMatcher.h
3+
// Copyright 2013 hamcrest.org. See LICENSE.txt
4+
//
5+
// Created by: Jon Reid, http://qualitycoding.org/
6+
// Docs: http://hamcrest.github.com/OCHamcrest/
7+
// Source: https://github.com/hamcrest/OCHamcrest
8+
//
9+
10+
#import <OCHamcrest/HCBaseMatcher.h>
11+
12+
13+
@interface HCClassMatcher : HCBaseMatcher
14+
{
15+
Class theClass;
16+
}
17+
18+
- (instancetype)initWithType:(Class)type;
19+
20+
@end
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
//
2+
// OCHamcrest - HCCollectMatchers.h
3+
// Copyright 2013 hamcrest.org. See LICENSE.txt
4+
//
5+
// Created by: Jon Reid, http://qualitycoding.org/
6+
// Docs: http://hamcrest.github.com/OCHamcrest/
7+
// Source: https://github.com/hamcrest/OCHamcrest
8+
//
9+
10+
#import <Foundation/Foundation.h>
11+
#import <objc/objc-api.h>
12+
13+
#import <stdarg.h>
14+
15+
@protocol HCMatcher;
16+
17+
18+
/**
19+
Returns an array of matchers from a variable-length comma-separated list terminated by @c nil.
20+
21+
@ingroup helpers
22+
*/
23+
OBJC_EXPORT NSMutableArray *HCCollectMatchers(id item1, va_list args);

0 commit comments

Comments
 (0)