Skip to content
This repository
Browse code

issue #206 - Rework support for Hamcrest matchers using a generic mec…

…hanism instead
  • Loading branch information...
commit 0080ba57af184c881d2036f23c4698fc71158257 1 parent 3c5d93c
Allen Ding authored January 31, 2013
2  Classes/KWContainMatcher.m
@@ -6,7 +6,7 @@
6 6
 
7 7
 #import "KWContainMatcher.h"
8 8
 #import "KWFormatter.h"
9  
-#import "KWHamrestMatchingAdditions.h"
  9
+#import "KWGenericMatchingAdditions.h"
10 10
 
11 11
 @interface KWContainMatcher()
12 12
 
17  Classes/KWGenericMatchEvaluator.h
... ...
@@ -0,0 +1,17 @@
  1
+//
  2
+//  KWGenericMatcher.h
  3
+//  Kiwi
  4
+//
  5
+//  Created by Allen Ding on 1/31/13.
  6
+//  Copyright (c) 2013 Allen Ding. All rights reserved.
  7
+//
  8
+
  9
+#import <Foundation/Foundation.h>
  10
+
  11
+@interface KWGenericMatchEvaluator : NSObject
  12
+
  13
++ (BOOL)isGenericMatcher:(id)object;
  14
+
  15
++ (BOOL)genericMatcher:(id)matcher matches:(id)object;
  16
+
  17
+@end
67  Classes/KWGenericMatchEvaluator.m
... ...
@@ -0,0 +1,67 @@
  1
+//
  2
+//  KWGenericMatcher.m
  3
+//  Kiwi
  4
+//
  5
+//  Created by Allen Ding on 1/31/13.
  6
+//  Copyright (c) 2013 Allen Ding. All rights reserved.
  7
+//
  8
+
  9
+#import "KWGenericMatchEvaluator.h"
  10
+#import "KWStringUtilities.h"
  11
+#import "KWObjCUtilities.h"
  12
+#import <objc/runtime.h>
  13
+
  14
+@implementation KWGenericMatchEvaluator
  15
+
  16
+// Returns true only if the object has a method with the signature "- (void)matches:(id)object"
  17
++ (BOOL)isGenericMatcher:(id)object
  18
+{
  19
+    Class theClass = object_getClass(object);
  20
+
  21
+    if (theClass == NULL) {
  22
+        return NO;
  23
+    }
  24
+
  25
+    Method method = class_getInstanceMethod(theClass, @selector(matches:));
  26
+
  27
+    if (method == NULL) {
  28
+        return NO;
  29
+    }
  30
+
  31
+    const char *cEncoding = method_getTypeEncoding(method);
  32
+
  33
+    if (cEncoding == NULL) {
  34
+        return NO;
  35
+    }
  36
+
  37
+    NSMethodSignature *signature = [NSMethodSignature signatureWithObjCTypes:cEncoding];
  38
+
  39
+    if (!KWObjCTypeEqualToObjCType(@encode(BOOL), [signature methodReturnType])) {
  40
+        return NO;
  41
+    }
  42
+
  43
+    if ([signature numberOfArguments] != 3) {
  44
+        return NO;
  45
+    }
  46
+
  47
+    if (!KWObjCTypeEqualToObjCType(@encode(id), [signature getArgumentTypeAtIndex:2])) {
  48
+        return NO;
  49
+    }
  50
+
  51
+    return YES;
  52
+}
  53
+
  54
++ (BOOL)genericMatcher:(id)matcher matches:(id)object
  55
+{
  56
+    NSString *targetEncoding = KWEncodingWithObjCTypes(@encode(BOOL), @encode(id), @encode(SEL), @encode(id), nil);
  57
+    NSMethodSignature *signature = [NSMethodSignature signatureWithObjCTypes:[targetEncoding UTF8String]];
  58
+    NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:signature];
  59
+    [invocation setSelector:@selector(matches:)];
  60
+    [invocation setArgument:&object atIndex:2];
  61
+    [invocation invokeWithTarget:matcher];
  62
+    BOOL result = NO;
  63
+    [invocation getReturnValue:&result];
  64
+    return result;
  65
+}
  66
+
  67
+@end
10  Classes/KWHamcrestMatcher.h → Classes/KWGenericMatcher.h
... ...
@@ -1,5 +1,5 @@
1 1
 //
2  
-//  KWHamcrestMatcher.h
  2
+//  KWGenericMatcher.h
3 3
 //  Kiwi
4 4
 //
5 5
 //  Created by Luke Redpath on 24/01/2011.
@@ -9,15 +9,11 @@
9 9
 #import <Foundation/Foundation.h>
10 10
 #import "KWMatcher.h"
11 11
 
12  
-@protocol HCMatcher;
13  
-
14  
-@interface KWHamcrestMatcher : KWMatcher {
15  
-  id<HCMatcher> hamcrestMatcher;
16  
-}
  12
+@interface KWGenericMatcher : KWMatcher
17 13
 
18 14
 #pragma mark -
19 15
 #pragma mark Configuring Matchers
20 16
 
21  
-- (void)match:(id<HCMatcher>)aMatcher;
  17
+- (void)match:(id)aMatcher;
22 18
 
23 19
 @end
16  Classes/KWHamcrestMatcher.m → Classes/KWGenericMatcher.m
... ...
@@ -1,24 +1,24 @@
1 1
 //
2  
-//  KWHamcrestMatcher.m
  2
+//  KWGenericMatcher.m
3 3
 //  Kiwi
4 4
 //
5 5
 //  Created by Luke Redpath on 24/01/2011.
6 6
 //  Copyright 2011 Allen Ding. All rights reserved.
7 7
 //
8 8
 
9  
-#import "KWHamcrestMatcher.h"
10  
-#import "KWHCMatcher.h"
  9
+#import "KWGenericMatcher.h"
  10
+#import "KWGenericMatchEvaluator.h"
11 11
 
12  
-@interface KWHamcrestMatcher ()
  12
+@interface KWGenericMatcher ()
13 13
 
14 14
 #pragma mark -
15 15
 #pragma mark Properties
16 16
 
17  
-@property (nonatomic, retain) id<HCMatcher> matcher;
  17
+@property (nonatomic, retain) id matcher;
18 18
 
19 19
 @end
20 20
 
21  
-@implementation KWHamcrestMatcher
  21
+@implementation KWGenericMatcher
22 22
 
23 23
 @synthesize matcher;
24 24
 
@@ -32,7 +32,7 @@ - (void)dealloc
32 32
 #pragma mark Matching
33 33
 
34 34
 - (BOOL)evaluate {
35  
-    return [self.matcher matches:self.subject];
  35
+    return [KWGenericMatchEvaluator genericMatcher:self.matcher matches:self.subject];
36 36
 }
37 37
 
38 38
 - (NSString *)failureMessageForShould {
@@ -54,7 +54,7 @@ + (NSArray *)matcherStrings {
54 54
 #pragma mark -
55 55
 #pragma mark Configuring Matchers
56 56
 
57  
-- (void)match:(id<HCMatcher>)aMatcher;
  57
+- (void)match:(id)aMatcher;
58 58
 {
59 59
     self.matcher = aMatcher;
60 60
 }
12  Classes/KWHamrestMatchingAdditions.h → Classes/KWGenericMatchingAdditions.h
@@ -8,28 +8,26 @@
8 8
 
9 9
 #import <Foundation/Foundation.h>
10 10
 
11  
-@interface NSObject (KiwiHamcrestAdditions)
  11
+@interface NSObject (KiwiGenericMatchingAdditions)
12 12
 
13 13
 - (BOOL)isEqualOrMatches:(id)object;
14 14
 
15 15
 @end
16 16
 
17  
-@protocol HCMatcher;
18  
-
19  
-@interface NSArray (KiwiHamcrestAdditions)
  17
+@interface NSArray (KiwiGenericMatchingAdditions)
20 18
 
21 19
 - (BOOL)containsObjectEqualToOrMatching:(id)object;
22  
-- (BOOL)containsObjectMatching:(id<HCMatcher>)matcher;
  20
+- (BOOL)containsObjectMatching:(id)matcher;
23 21
 
24 22
 @end
25 23
 
26  
-@interface NSSet (KiwiHamcrestAdditions)
  24
+@interface NSSet (KiwiGenericMatchingAdditions)
27 25
 
28 26
 - (BOOL)containsObjectEqualToOrMatching:(id)object;
29 27
 
30 28
 @end
31 29
 
32  
-@interface NSOrderedSet (KiwiHamcrestAdditions)
  30
+@interface NSOrderedSet (KiwiGenericMatchingAdditions)
33 31
 
34 32
 - (BOOL)containsObjectEqualToOrMatching:(id)object;
35 33
 
31  Classes/KWHamrestMatchingAdditions.m → Classes/KWGenericMatchingAdditions.m
@@ -6,37 +6,38 @@
6 6
 //  Copyright 2011 Allen Ding. All rights reserved.
7 7
 //
8 8
 
9  
-#import "KWHamrestMatchingAdditions.h"
10  
-#import "KWHCMatcher.h"
  9
+#import "KWGenericMatchingAdditions.h"
  10
+#import "KWGenericMatcher.h"
  11
+#import "KWGenericMatchEvaluator.h"
11 12
 
12  
-@implementation NSObject (KiwiHamcrestAdditions)
  13
+@implementation NSObject (KiwiGenericMatchingAdditions)
13 14
 
14 15
 - (BOOL)isEqualOrMatches:(id)object
15 16
 {
16  
-    if ([self conformsToProtocol:@protocol(HCMatcher)]) {
17  
-        return [(id<HCMatcher>)self matches:object];
  17
+    if ([KWGenericMatchEvaluator isGenericMatcher:self]) {
  18
+        return [KWGenericMatchEvaluator genericMatcher:self matches:object];
18 19
     }
19 20
     return [self isEqual:object];
20 21
 }
21 22
 
22 23
 @end
23 24
 
24  
-@implementation NSArray (KiwiHamcrestAdditions)
  25
+@implementation NSArray (KiwiGenericMatchingAdditions)
25 26
 
26 27
 - (BOOL)containsObjectEqualToOrMatching:(id)object
27 28
 {
28  
-    if ([object conformsToProtocol:@protocol(HCMatcher)]) {
  29
+    if ([KWGenericMatchEvaluator isGenericMatcher:object]) {
29 30
         return [self containsObjectMatching:object];
30 31
     }
31 32
     return [self containsObject:object];
32 33
 }
33 34
 
34  
-- (BOOL)containsObjectMatching:(id<HCMatcher>)matcher
  35
+- (BOOL)containsObjectMatching:(id)matcher
35 36
 {
36 37
     NSIndexSet *indexSet = [self indexesOfObjectsPassingTest:^(id obj, NSUInteger idx, BOOL *stop) {
37  
-        BOOL matches = [matcher matches:obj];
  38
+        BOOL matches = [KWGenericMatchEvaluator genericMatcher:matcher matches:obj];
38 39
         if (matches) {
39  
-          *stop = YES;
  40
+            *stop = YES;
40 41
         }
41 42
         return matches;
42 43
     }];
@@ -46,11 +47,11 @@ - (BOOL)containsObjectMatching:(id<HCMatcher>)matcher
46 47
 
47 48
 @end
48 49
 
49  
-@implementation NSSet (KiwiHamcrestAdditions)
  50
+@implementation NSSet (KiwiGenericMatchingAdditions)
50 51
 
51 52
 - (BOOL)containsObjectEqualToOrMatching:(id)object
52 53
 {
53  
-    if ([object conformsToProtocol:@protocol(HCMatcher)]) {
  54
+    if ([KWGenericMatchEvaluator isGenericMatcher:object]) {
54 55
         return [[self allObjects] containsObjectMatching:object];
55 56
     }
56 57
     return [self containsObject:object];
@@ -58,16 +59,14 @@ - (BOOL)containsObjectEqualToOrMatching:(id)object
58 59
 
59 60
 @end
60 61
 
61  
-@implementation NSOrderedSet (KiwiHamcrestAdditions)
  62
+@implementation NSOrderedSet (KiwiGenericMatchingAdditions)
62 63
 
63 64
 - (BOOL)containsObjectEqualToOrMatching:(id)object
64 65
 {
65  
-    if ([object conformsToProtocol:@protocol(HCMatcher)]) {
  66
+    if ([KWGenericMatchEvaluator isGenericMatcher:object]) {
66 67
         return [[self array] containsObjectMatching:object];
67 68
     }
68 69
     return [self containsObject:object];
69 70
 }
70 71
 
71 72
 @end
72  
-
73  
-
12  Classes/KWHCMatcher.h
... ...
@@ -1,12 +0,0 @@
1  
-/**
2  
- * This is a minimal version of HCMatcher from the Hamcrest library, purely
3  
- * to support Hamcrest integration with Kiwi.
4  
- *
5  
- * The Hamcrest project can be found here: http://code.google.com/p/hamcrest/
6  
- */
7  
-
8  
-#import <Foundation/Foundation.h>
9  
-
10  
-@protocol HCMatcher <NSObject>
11  
-- (BOOL)matches:(id)item;
12  
-@end
4  Classes/KWHaveValueMatcher.m
@@ -7,8 +7,8 @@
7 7
 //
8 8
 
9 9
 #import "KWHaveValueMatcher.h"
10  
-#import "KWHamrestMatchingAdditions.h"
11  
-#import "KWHCMatcher.h"
  10
+#import "KWGenericMatchingAdditions.h"
  11
+#import "KWGenericMatcher.h"
12 12
 #import "KWFormatter.h"
13 13
 
14 14
 @interface KWHaveValueMatcher()
10  Classes/KWMessagePattern.m
@@ -11,7 +11,7 @@
11 11
 #import "KWValue.h"
12 12
 #import "NSInvocation+KiwiAdditions.h"
13 13
 #import "NSMethodSignature+KiwiAdditions.h"
14  
-#import "KWHCMatcher.h"
  14
+#import "KWGenericMatchEvaluator.h"
15 15
 #import "Kiwi.h"
16 16
 
17 17
 @implementation KWMessagePattern
@@ -137,14 +137,14 @@ - (BOOL)argumentFiltersMatchInvocationArguments:(NSInvocation *)anInvocation {
137 137
             continue;
138 138
         }
139 139
 
140  
-        if ([argumentFilter conformsToProtocol:@protocol(HCMatcher)]) {
141  
-            id<HCMatcher> matcher = (id<HCMatcher>)argumentFilter;
  140
+        if ([KWGenericMatchEvaluator isGenericMatcher:argumentFilter]) {
  141
+            id matcher = argumentFilter;
142 142
             if ([object isKindOfClass:[KWValue class]] && [object isNumeric]) {
143 143
                 NSNumber *number = [object numberValue];
144  
-                if (![matcher matches:number]) {
  144
+                if (![KWGenericMatchEvaluator genericMatcher:matcher matches:number]) {
145 145
                     return NO;
146 146
                 }
147  
-            } else if (![matcher matches:object]) {
  147
+            } else if (![KWGenericMatchEvaluator genericMatcher:matcher matches:object]) {
148 148
                 return NO;
149 149
             }
150 150
         } else if ([argumentFilter isEqual:[KWNull null]]) {
4  Classes/KWStringContainsMatcher.h
@@ -7,14 +7,14 @@
7 7
 //
8 8
 
9 9
 #import <Foundation/Foundation.h>
10  
-#import "KWHCMatcher.h"
11 10
 
12  
-@interface KWStringContainsMatcher : NSObject <HCMatcher> {
  11
+@interface KWStringContainsMatcher : NSObject {
13 12
   NSString *substring;
14 13
 }
15 14
 
16 15
 + (id)matcherWithSubstring:(NSString *)aSubstring;
17 16
 - (id)initWithSubstring:(NSString *)aSubstring;
  17
+- (BOOL)matches:(id)object;
18 18
 
19 19
 @end
20 20
 
3  Classes/KWStringPrefixMatcher.h
@@ -7,9 +7,8 @@
7 7
 //
8 8
 
9 9
 #import <Foundation/Foundation.h>
10  
-#import "KWHCMatcher.h"
11 10
 
12  
-@interface KWStringPrefixMatcher : NSObject <HCMatcher> {
  11
+@interface KWStringPrefixMatcher : NSObject {
13 12
   NSString *prefix;
14 13
 }
15 14
 + (id)matcherWithPrefix:(NSString *)aPrefix;
2  Classes/Kiwi.h
@@ -48,7 +48,7 @@ extern "C" {
48 48
 #import "KWFailure.h"
49 49
 #import "KWFormatter.h"
50 50
 #import "KWFutureObject.h"
51  
-#import "KWHamcrestMatcher.h"
  51
+#import "KWGenericMatcher.h"
52 52
 #import "KWHaveMatcher.h"
53 53
 #import "KWHaveValueMatcher.h"
54 54
 #import "KWInequalityMatcher.h"
74  Kiwi.xcodeproj/project.pbxproj
@@ -30,6 +30,10 @@
30 30
 		511901A716A95CDE006E7359 /* KWChangeMatcher.m in Sources */ = {isa = PBXBuildFile; fileRef = 511901A416A95CDE006E7359 /* KWChangeMatcher.m */; };
31 31
 		511901A816A95CDE006E7359 /* KWChangeMatcher.m in Sources */ = {isa = PBXBuildFile; fileRef = 511901A416A95CDE006E7359 /* KWChangeMatcher.m */; };
32 32
 		89F9CB7C16B1C2C400E87D34 /* KWFunctionalTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 89F9CB7B16B1C2C400E87D34 /* KWFunctionalTests.m */; };
  33
+		9F90FBF016BA5FF20057426D /* KWGenericMatchEvaluator.h in Headers */ = {isa = PBXBuildFile; fileRef = 9F90FBEE16BA5FF20057426D /* KWGenericMatchEvaluator.h */; };
  34
+		9F90FBF116BA5FF20057426D /* KWGenericMatchEvaluator.h in Headers */ = {isa = PBXBuildFile; fileRef = 9F90FBEE16BA5FF20057426D /* KWGenericMatchEvaluator.h */; };
  35
+		9F90FBF216BA5FF20057426D /* KWGenericMatchEvaluator.m in Sources */ = {isa = PBXBuildFile; fileRef = 9F90FBEF16BA5FF20057426D /* KWGenericMatchEvaluator.m */; };
  36
+		9F90FBF316BA5FF20057426D /* KWGenericMatchEvaluator.m in Sources */ = {isa = PBXBuildFile; fileRef = 9F90FBEF16BA5FF20057426D /* KWGenericMatchEvaluator.m */; };
33 37
 		9F982A3816A801800030A0B1 /* Carrier.m in Sources */ = {isa = PBXBuildFile; fileRef = 9F982A1E16A801800030A0B1 /* Carrier.m */; };
34 38
 		9F982A3916A801800030A0B1 /* Cruiser.m in Sources */ = {isa = PBXBuildFile; fileRef = 9F982A2016A801800030A0B1 /* Cruiser.m */; };
35 39
 		9F982A3A16A801800030A0B1 /* Engine.m in Sources */ = {isa = PBXBuildFile; fileRef = 9F982A2216A801800030A0B1 /* Engine.m */; };
@@ -198,14 +202,14 @@
198 202
 		9F982D7916A802920030A0B1 /* KWFutureObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 9F982C8616A802920030A0B1 /* KWFutureObject.h */; };
199 203
 		9F982D7A16A802920030A0B1 /* KWFutureObject.m in Sources */ = {isa = PBXBuildFile; fileRef = 9F982C8716A802920030A0B1 /* KWFutureObject.m */; };
200 204
 		9F982D7B16A802920030A0B1 /* KWFutureObject.m in Sources */ = {isa = PBXBuildFile; fileRef = 9F982C8716A802920030A0B1 /* KWFutureObject.m */; };
201  
-		9F982D7C16A802920030A0B1 /* KWHamcrestMatcher.h in Headers */ = {isa = PBXBuildFile; fileRef = 9F982C8816A802920030A0B1 /* KWHamcrestMatcher.h */; };
202  
-		9F982D7D16A802920030A0B1 /* KWHamcrestMatcher.h in Headers */ = {isa = PBXBuildFile; fileRef = 9F982C8816A802920030A0B1 /* KWHamcrestMatcher.h */; };
203  
-		9F982D7E16A802920030A0B1 /* KWHamcrestMatcher.m in Sources */ = {isa = PBXBuildFile; fileRef = 9F982C8916A802920030A0B1 /* KWHamcrestMatcher.m */; };
204  
-		9F982D7F16A802920030A0B1 /* KWHamcrestMatcher.m in Sources */ = {isa = PBXBuildFile; fileRef = 9F982C8916A802920030A0B1 /* KWHamcrestMatcher.m */; };
205  
-		9F982D8016A802920030A0B1 /* KWHamrestMatchingAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 9F982C8A16A802920030A0B1 /* KWHamrestMatchingAdditions.h */; };
206  
-		9F982D8116A802920030A0B1 /* KWHamrestMatchingAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 9F982C8A16A802920030A0B1 /* KWHamrestMatchingAdditions.h */; };
207  
-		9F982D8216A802920030A0B1 /* KWHamrestMatchingAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 9F982C8B16A802920030A0B1 /* KWHamrestMatchingAdditions.m */; };
208  
-		9F982D8316A802920030A0B1 /* KWHamrestMatchingAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 9F982C8B16A802920030A0B1 /* KWHamrestMatchingAdditions.m */; };
  205
+		9F982D7C16A802920030A0B1 /* KWGenericMatcher.h in Headers */ = {isa = PBXBuildFile; fileRef = 9F982C8816A802920030A0B1 /* KWGenericMatcher.h */; };
  206
+		9F982D7D16A802920030A0B1 /* KWGenericMatcher.h in Headers */ = {isa = PBXBuildFile; fileRef = 9F982C8816A802920030A0B1 /* KWGenericMatcher.h */; };
  207
+		9F982D7E16A802920030A0B1 /* KWGenericMatcher.m in Sources */ = {isa = PBXBuildFile; fileRef = 9F982C8916A802920030A0B1 /* KWGenericMatcher.m */; };
  208
+		9F982D7F16A802920030A0B1 /* KWGenericMatcher.m in Sources */ = {isa = PBXBuildFile; fileRef = 9F982C8916A802920030A0B1 /* KWGenericMatcher.m */; };
  209
+		9F982D8016A802920030A0B1 /* KWGenericMatchingAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 9F982C8A16A802920030A0B1 /* KWGenericMatchingAdditions.h */; };
  210
+		9F982D8116A802920030A0B1 /* KWGenericMatchingAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 9F982C8A16A802920030A0B1 /* KWGenericMatchingAdditions.h */; };
  211
+		9F982D8216A802920030A0B1 /* KWGenericMatchingAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 9F982C8B16A802920030A0B1 /* KWGenericMatchingAdditions.m */; };
  212
+		9F982D8316A802920030A0B1 /* KWGenericMatchingAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 9F982C8B16A802920030A0B1 /* KWGenericMatchingAdditions.m */; };
209 213
 		9F982D8416A802920030A0B1 /* KWHaveMatcher.h in Headers */ = {isa = PBXBuildFile; fileRef = 9F982C8C16A802920030A0B1 /* KWHaveMatcher.h */; };
210 214
 		9F982D8516A802920030A0B1 /* KWHaveMatcher.h in Headers */ = {isa = PBXBuildFile; fileRef = 9F982C8C16A802920030A0B1 /* KWHaveMatcher.h */; };
211 215
 		9F982D8616A802920030A0B1 /* KWHaveMatcher.m in Sources */ = {isa = PBXBuildFile; fileRef = 9F982C8D16A802920030A0B1 /* KWHaveMatcher.m */; };
@@ -214,8 +218,6 @@
214 218
 		9F982D8916A802920030A0B1 /* KWHaveValueMatcher.h in Headers */ = {isa = PBXBuildFile; fileRef = 9F982C8E16A802920030A0B1 /* KWHaveValueMatcher.h */; };
215 219
 		9F982D8A16A802920030A0B1 /* KWHaveValueMatcher.m in Sources */ = {isa = PBXBuildFile; fileRef = 9F982C8F16A802920030A0B1 /* KWHaveValueMatcher.m */; };
216 220
 		9F982D8B16A802920030A0B1 /* KWHaveValueMatcher.m in Sources */ = {isa = PBXBuildFile; fileRef = 9F982C8F16A802920030A0B1 /* KWHaveValueMatcher.m */; };
217  
-		9F982D8C16A802920030A0B1 /* KWHCMatcher.h in Headers */ = {isa = PBXBuildFile; fileRef = 9F982C9016A802920030A0B1 /* KWHCMatcher.h */; };
218  
-		9F982D8D16A802920030A0B1 /* KWHCMatcher.h in Headers */ = {isa = PBXBuildFile; fileRef = 9F982C9016A802920030A0B1 /* KWHCMatcher.h */; };
219 221
 		9F982D8E16A802920030A0B1 /* KWInequalityMatcher.h in Headers */ = {isa = PBXBuildFile; fileRef = 9F982C9116A802920030A0B1 /* KWInequalityMatcher.h */; };
220 222
 		9F982D8F16A802920030A0B1 /* KWInequalityMatcher.h in Headers */ = {isa = PBXBuildFile; fileRef = 9F982C9116A802920030A0B1 /* KWInequalityMatcher.h */; };
221 223
 		9F982D9016A802920030A0B1 /* KWInequalityMatcher.m in Sources */ = {isa = PBXBuildFile; fileRef = 9F982C9216A802920030A0B1 /* KWInequalityMatcher.m */; };
@@ -375,7 +377,7 @@
375 377
 		9F982E2A16A802920030A0B1 /* NSValue+KiwiAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 9F982CDF16A802920030A0B1 /* NSValue+KiwiAdditions.m */; };
376 378
 		9F982E2B16A802920030A0B1 /* NSValue+KiwiAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 9F982CDF16A802920030A0B1 /* NSValue+KiwiAdditions.m */; };
377 379
 		A352E9E812EDC30A0049C691 /* KWHaveValueMatcherTest.m in Sources */ = {isa = PBXBuildFile; fileRef = A352E9E712EDC30A0049C691 /* KWHaveValueMatcherTest.m */; };
378  
-		A352EA1B12EDC8380049C691 /* KWHamcrestMatcherTest.m in Sources */ = {isa = PBXBuildFile; fileRef = A352EA1A12EDC8380049C691 /* KWHamcrestMatcherTest.m */; };
  380
+		A352EA1B12EDC8380049C691 /* KWGenericMatcherTest.m in Sources */ = {isa = PBXBuildFile; fileRef = A352EA1A12EDC8380049C691 /* KWGenericMatcherTest.m */; };
379 381
 		A385CAE813AA7EA200DCA951 /* KWUserDefinedMatcherTest.m in Sources */ = {isa = PBXBuildFile; fileRef = A385CAE713AA7EA200DCA951 /* KWUserDefinedMatcherTest.m */; };
380 382
 		C922D1DD158045FC00995B43 /* KWStringContainsMatcherTest.m in Sources */ = {isa = PBXBuildFile; fileRef = C922D1DC158045FC00995B43 /* KWStringContainsMatcherTest.m */; };
381 383
 		F5015CBD1158404E002E9A98 /* libKiwi.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F5015B9F11583A77002E9A98 /* libKiwi.a */; };
@@ -437,6 +439,8 @@
437 439
 		832C83C7157263B300F160D5 /* libKiwi-OSX.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libKiwi-OSX.a"; sourceTree = BUILT_PRODUCTS_DIR; };
438 440
 		89F9CB7B16B1C2C400E87D34 /* KWFunctionalTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KWFunctionalTests.m; sourceTree = "<group>"; };
439 441
 		9F4C095816B16A6D00FCCCD3 /* Release.txt */ = {isa = PBXFileReference; lastKnownFileType = text; path = Release.txt; sourceTree = "<group>"; };
  442
+		9F90FBEE16BA5FF20057426D /* KWGenericMatchEvaluator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = KWGenericMatchEvaluator.h; path = Classes/KWGenericMatchEvaluator.h; sourceTree = "<group>"; };
  443
+		9F90FBEF16BA5FF20057426D /* KWGenericMatchEvaluator.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = KWGenericMatchEvaluator.m; path = Classes/KWGenericMatchEvaluator.m; sourceTree = "<group>"; };
440 444
 		9F982A1616A7FCD00030A0B1 /* Kiwi.podspec */ = {isa = PBXFileReference; lastKnownFileType = text; path = Kiwi.podspec; sourceTree = "<group>"; };
441 445
 		9F982A1D16A801800030A0B1 /* Carrier.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Carrier.h; path = "Test Classes/Carrier.h"; sourceTree = "<group>"; };
442 446
 		9F982A1E16A801800030A0B1 /* Carrier.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = Carrier.m; path = "Test Classes/Carrier.m"; sourceTree = "<group>"; };
@@ -546,15 +550,14 @@
546 550
 		9F982C8516A802920030A0B1 /* KWFormatter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = KWFormatter.m; path = Classes/KWFormatter.m; sourceTree = "<group>"; };
547 551
 		9F982C8616A802920030A0B1 /* KWFutureObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = KWFutureObject.h; path = Classes/KWFutureObject.h; sourceTree = "<group>"; };
548 552
 		9F982C8716A802920030A0B1 /* KWFutureObject.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = KWFutureObject.m; path = Classes/KWFutureObject.m; sourceTree = "<group>"; };
549  
-		9F982C8816A802920030A0B1 /* KWHamcrestMatcher.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = KWHamcrestMatcher.h; path = Classes/KWHamcrestMatcher.h; sourceTree = "<group>"; };
550  
-		9F982C8916A802920030A0B1 /* KWHamcrestMatcher.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = KWHamcrestMatcher.m; path = Classes/KWHamcrestMatcher.m; sourceTree = "<group>"; };
551  
-		9F982C8A16A802920030A0B1 /* KWHamrestMatchingAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = KWHamrestMatchingAdditions.h; path = Classes/KWHamrestMatchingAdditions.h; sourceTree = "<group>"; };
552  
-		9F982C8B16A802920030A0B1 /* KWHamrestMatchingAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = KWHamrestMatchingAdditions.m; path = Classes/KWHamrestMatchingAdditions.m; sourceTree = "<group>"; };
  553
+		9F982C8816A802920030A0B1 /* KWGenericMatcher.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = KWGenericMatcher.h; path = Classes/KWGenericMatcher.h; sourceTree = "<group>"; };
  554
+		9F982C8916A802920030A0B1 /* KWGenericMatcher.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = KWGenericMatcher.m; path = Classes/KWGenericMatcher.m; sourceTree = "<group>"; };
  555
+		9F982C8A16A802920030A0B1 /* KWGenericMatchingAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = KWGenericMatchingAdditions.h; path = Classes/KWGenericMatchingAdditions.h; sourceTree = "<group>"; };
  556
+		9F982C8B16A802920030A0B1 /* KWGenericMatchingAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = KWGenericMatchingAdditions.m; path = Classes/KWGenericMatchingAdditions.m; sourceTree = "<group>"; };
553 557
 		9F982C8C16A802920030A0B1 /* KWHaveMatcher.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = KWHaveMatcher.h; path = Classes/KWHaveMatcher.h; sourceTree = "<group>"; };
554 558
 		9F982C8D16A802920030A0B1 /* KWHaveMatcher.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = KWHaveMatcher.m; path = Classes/KWHaveMatcher.m; sourceTree = "<group>"; };
555 559
 		9F982C8E16A802920030A0B1 /* KWHaveValueMatcher.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = KWHaveValueMatcher.h; path = Classes/KWHaveValueMatcher.h; sourceTree = "<group>"; };
556 560
 		9F982C8F16A802920030A0B1 /* KWHaveValueMatcher.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = KWHaveValueMatcher.m; path = Classes/KWHaveValueMatcher.m; sourceTree = "<group>"; };
557  
-		9F982C9016A802920030A0B1 /* KWHCMatcher.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = KWHCMatcher.h; path = Classes/KWHCMatcher.h; sourceTree = "<group>"; };
558 561
 		9F982C9116A802920030A0B1 /* KWInequalityMatcher.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = KWInequalityMatcher.h; path = Classes/KWInequalityMatcher.h; sourceTree = "<group>"; };
559 562
 		9F982C9216A802920030A0B1 /* KWInequalityMatcher.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = KWInequalityMatcher.m; path = Classes/KWInequalityMatcher.m; sourceTree = "<group>"; };
560 563
 		9F982C9316A802920030A0B1 /* KWIntercept.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = KWIntercept.h; path = Classes/KWIntercept.h; sourceTree = "<group>"; };
@@ -636,7 +639,7 @@
636 639
 		9F982CDF16A802920030A0B1 /* NSValue+KiwiAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "NSValue+KiwiAdditions.m"; path = "Classes/NSValue+KiwiAdditions.m"; sourceTree = "<group>"; };
637 640
 		9FFA190B16A83C23009D6FF1 /* uninstall-templates.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; name = "uninstall-templates.sh"; path = "Xcode Templates/uninstall-templates.sh"; sourceTree = "<group>"; };
638 641
 		A352E9E712EDC30A0049C691 /* KWHaveValueMatcherTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KWHaveValueMatcherTest.m; sourceTree = "<group>"; };
639  
-		A352EA1A12EDC8380049C691 /* KWHamcrestMatcherTest.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = KWHamcrestMatcherTest.m; sourceTree = "<group>"; tabWidth = 4; };
  642
+		A352EA1A12EDC8380049C691 /* KWGenericMatcherTest.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = KWGenericMatcherTest.m; sourceTree = "<group>"; tabWidth = 4; };
640 643
 		A385CAE713AA7EA200DCA951 /* KWUserDefinedMatcherTest.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = KWUserDefinedMatcherTest.m; sourceTree = "<group>"; tabWidth = 4; };
641 644
 		C922D1DC158045FC00995B43 /* KWStringContainsMatcherTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KWStringContainsMatcherTest.m; sourceTree = "<group>"; };
642 645
 		F5015B8B11583A39002E9A98 /* KiwiDriver-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "KiwiDriver-Info.plist"; sourceTree = "<group>"; };
@@ -928,15 +931,16 @@
928 931
 				9F982C8516A802920030A0B1 /* KWFormatter.m */,
929 932
 				9F982C8616A802920030A0B1 /* KWFutureObject.h */,
930 933
 				9F982C8716A802920030A0B1 /* KWFutureObject.m */,
931  
-				9F982C8816A802920030A0B1 /* KWHamcrestMatcher.h */,
932  
-				9F982C8916A802920030A0B1 /* KWHamcrestMatcher.m */,
933  
-				9F982C8A16A802920030A0B1 /* KWHamrestMatchingAdditions.h */,
934  
-				9F982C8B16A802920030A0B1 /* KWHamrestMatchingAdditions.m */,
  934
+				9F982C8816A802920030A0B1 /* KWGenericMatcher.h */,
  935
+				9F982C8916A802920030A0B1 /* KWGenericMatcher.m */,
  936
+				9F90FBEE16BA5FF20057426D /* KWGenericMatchEvaluator.h */,
  937
+				9F90FBEF16BA5FF20057426D /* KWGenericMatchEvaluator.m */,
  938
+				9F982C8A16A802920030A0B1 /* KWGenericMatchingAdditions.h */,
  939
+				9F982C8B16A802920030A0B1 /* KWGenericMatchingAdditions.m */,
935 940
 				9F982C8C16A802920030A0B1 /* KWHaveMatcher.h */,
936 941
 				9F982C8D16A802920030A0B1 /* KWHaveMatcher.m */,
937 942
 				9F982C8E16A802920030A0B1 /* KWHaveValueMatcher.h */,
938 943
 				9F982C8F16A802920030A0B1 /* KWHaveValueMatcher.m */,
939  
-				9F982C9016A802920030A0B1 /* KWHCMatcher.h */,
940 944
 				9F982C9116A802920030A0B1 /* KWInequalityMatcher.h */,
941 945
 				9F982C9216A802920030A0B1 /* KWInequalityMatcher.m */,
942 946
 				9F982C9316A802920030A0B1 /* KWIntercept.h */,
@@ -1087,7 +1091,7 @@
1087 1091
 				F5C36E91115C9F0700425FDA /* KWReceiveMatcherTest.m */,
1088 1092
 				F553B6641175D48C004FCA2E /* KWRespondToSelectorMatcherTest.m */,
1089 1093
 				A352E9E712EDC30A0049C691 /* KWHaveValueMatcherTest.m */,
1090  
-				A352EA1A12EDC8380049C691 /* KWHamcrestMatcherTest.m */,
  1094
+				A352EA1A12EDC8380049C691 /* KWGenericMatcherTest.m */,
1091 1095
 				A385CAE713AA7EA200DCA951 /* KWUserDefinedMatcherTest.m */,
1092 1096
 				511901A016A95803006E7359 /* KWChangeMatcherTest.m */,
1093 1097
 			);
@@ -1154,11 +1158,10 @@
1154 1158
 				9F982D7116A802920030A0B1 /* KWFailure.h in Headers */,
1155 1159
 				9F982D7516A802920030A0B1 /* KWFormatter.h in Headers */,
1156 1160
 				9F982D7916A802920030A0B1 /* KWFutureObject.h in Headers */,
1157  
-				9F982D7D16A802920030A0B1 /* KWHamcrestMatcher.h in Headers */,
1158  
-				9F982D8116A802920030A0B1 /* KWHamrestMatchingAdditions.h in Headers */,
  1161
+				9F982D7D16A802920030A0B1 /* KWGenericMatcher.h in Headers */,
  1162
+				9F982D8116A802920030A0B1 /* KWGenericMatchingAdditions.h in Headers */,
1159 1163
 				9F982D8516A802920030A0B1 /* KWHaveMatcher.h in Headers */,
1160 1164
 				9F982D8916A802920030A0B1 /* KWHaveValueMatcher.h in Headers */,
1161  
-				9F982D8D16A802920030A0B1 /* KWHCMatcher.h in Headers */,
1162 1165
 				9F982D8F16A802920030A0B1 /* KWInequalityMatcher.h in Headers */,
1163 1166
 				9F982D9316A802920030A0B1 /* KWIntercept.h in Headers */,
1164 1167
 				9F982D9716A802920030A0B1 /* KWInvocationCapturer.h in Headers */,
@@ -1202,6 +1205,7 @@
1202 1205
 				9F982E2516A802920030A0B1 /* NSObject+KiwiVerifierAdditions.h in Headers */,
1203 1206
 				9F982E2916A802920030A0B1 /* NSValue+KiwiAdditions.h in Headers */,
1204 1207
 				511901A616A95CDE006E7359 /* KWChangeMatcher.h in Headers */,
  1208
+				9F90FBF116BA5FF20057426D /* KWGenericMatchEvaluator.h in Headers */,
1205 1209
 			);
1206 1210
 			runOnlyForDeploymentPostprocessing = 0;
1207 1211
 		};
@@ -1253,11 +1257,10 @@
1253 1257
 				9F982D7016A802920030A0B1 /* KWFailure.h in Headers */,
1254 1258
 				9F982D7416A802920030A0B1 /* KWFormatter.h in Headers */,
1255 1259
 				9F982D7816A802920030A0B1 /* KWFutureObject.h in Headers */,
1256  
-				9F982D7C16A802920030A0B1 /* KWHamcrestMatcher.h in Headers */,
1257  
-				9F982D8016A802920030A0B1 /* KWHamrestMatchingAdditions.h in Headers */,
  1260
+				9F982D7C16A802920030A0B1 /* KWGenericMatcher.h in Headers */,
  1261
+				9F982D8016A802920030A0B1 /* KWGenericMatchingAdditions.h in Headers */,
1258 1262
 				9F982D8416A802920030A0B1 /* KWHaveMatcher.h in Headers */,
1259 1263
 				9F982D8816A802920030A0B1 /* KWHaveValueMatcher.h in Headers */,
1260  
-				9F982D8C16A802920030A0B1 /* KWHCMatcher.h in Headers */,
1261 1264
 				9F982D8E16A802920030A0B1 /* KWInequalityMatcher.h in Headers */,
1262 1265
 				9F982D9216A802920030A0B1 /* KWIntercept.h in Headers */,
1263 1266
 				9F982D9616A802920030A0B1 /* KWInvocationCapturer.h in Headers */,
@@ -1301,6 +1304,7 @@
1301 1304
 				9F982E2416A802920030A0B1 /* NSObject+KiwiVerifierAdditions.h in Headers */,
1302 1305
 				9F982E2816A802920030A0B1 /* NSValue+KiwiAdditions.h in Headers */,
1303 1306
 				511901A516A95CDE006E7359 /* KWChangeMatcher.h in Headers */,
  1307
+				9F90FBF016BA5FF20057426D /* KWGenericMatchEvaluator.h in Headers */,
1304 1308
 			);
1305 1309
 			runOnlyForDeploymentPostprocessing = 0;
1306 1310
 		};
@@ -1504,8 +1508,8 @@
1504 1508
 				9F982D7316A802920030A0B1 /* KWFailure.m in Sources */,
1505 1509
 				9F982D7716A802920030A0B1 /* KWFormatter.m in Sources */,
1506 1510
 				9F982D7B16A802920030A0B1 /* KWFutureObject.m in Sources */,
1507  
-				9F982D7F16A802920030A0B1 /* KWHamcrestMatcher.m in Sources */,
1508  
-				9F982D8316A802920030A0B1 /* KWHamrestMatchingAdditions.m in Sources */,
  1511
+				9F982D7F16A802920030A0B1 /* KWGenericMatcher.m in Sources */,
  1512
+				9F982D8316A802920030A0B1 /* KWGenericMatchingAdditions.m in Sources */,
1509 1513
 				9F982D8716A802920030A0B1 /* KWHaveMatcher.m in Sources */,
1510 1514
 				9F982D8B16A802920030A0B1 /* KWHaveValueMatcher.m in Sources */,
1511 1515
 				9F982D9116A802920030A0B1 /* KWInequalityMatcher.m in Sources */,
@@ -1546,6 +1550,7 @@
1546 1550
 				9F982E2716A802920030A0B1 /* NSObject+KiwiVerifierAdditions.m in Sources */,
1547 1551
 				9F982E2B16A802920030A0B1 /* NSValue+KiwiAdditions.m in Sources */,
1548 1552
 				511901A816A95CDE006E7359 /* KWChangeMatcher.m in Sources */,
  1553
+				9F90FBF316BA5FF20057426D /* KWGenericMatchEvaluator.m in Sources */,
1549 1554
 			);
1550 1555
 			runOnlyForDeploymentPostprocessing = 0;
1551 1556
 		};
@@ -1587,8 +1592,8 @@
1587 1592
 				9F982D7216A802920030A0B1 /* KWFailure.m in Sources */,
1588 1593
 				9F982D7616A802920030A0B1 /* KWFormatter.m in Sources */,
1589 1594
 				9F982D7A16A802920030A0B1 /* KWFutureObject.m in Sources */,
1590  
-				9F982D7E16A802920030A0B1 /* KWHamcrestMatcher.m in Sources */,
1591  
-				9F982D8216A802920030A0B1 /* KWHamrestMatchingAdditions.m in Sources */,
  1595
+				9F982D7E16A802920030A0B1 /* KWGenericMatcher.m in Sources */,
  1596
+				9F982D8216A802920030A0B1 /* KWGenericMatchingAdditions.m in Sources */,
1592 1597
 				9F982D8616A802920030A0B1 /* KWHaveMatcher.m in Sources */,
1593 1598
 				9F982D8A16A802920030A0B1 /* KWHaveValueMatcher.m in Sources */,
1594 1599
 				9F982D9016A802920030A0B1 /* KWInequalityMatcher.m in Sources */,
@@ -1630,6 +1635,7 @@
1630 1635
 				9F982E2A16A802920030A0B1 /* NSValue+KiwiAdditions.m in Sources */,
1631 1636
 				511901A116A95803006E7359 /* KWChangeMatcherTest.m in Sources */,
1632 1637
 				511901A716A95CDE006E7359 /* KWChangeMatcher.m in Sources */,
  1638
+				9F90FBF216BA5FF20057426D /* KWGenericMatchEvaluator.m in Sources */,
1633 1639
 			);
1634 1640
 			runOnlyForDeploymentPostprocessing = 0;
1635 1641
 		};
@@ -1665,7 +1671,7 @@
1665 1671
 				F5B168DA11BCC58200200D1D /* KWExampleGroupBuilderTest.m in Sources */,
1666 1672
 				F5B16B4E11BD56AE00200D1D /* KWContextNodeTest.m in Sources */,
1667 1673
 				A352E9E812EDC30A0049C691 /* KWHaveValueMatcherTest.m in Sources */,
1668  
-				A352EA1B12EDC8380049C691 /* KWHamcrestMatcherTest.m in Sources */,
  1674
+				A352EA1B12EDC8380049C691 /* KWGenericMatcherTest.m in Sources */,
1669 1675
 				A385CAE813AA7EA200DCA951 /* KWUserDefinedMatcherTest.m in Sources */,
1670 1676
 				4BA52D0115487F0C00FC957B /* KWCaptureTest.m in Sources */,
1671 1677
 				C922D1DD158045FC00995B43 /* KWStringContainsMatcherTest.m in Sources */,
4  Tests/KWContainMatcherTest.m
@@ -61,7 +61,7 @@ - (void)testItShouldNotMatchNonContainedArrayObjects {
61 61
     STAssertFalse([matcher evaluate], @"expected negative match");
62 62
 }
63 63
 
64  
-- (void)testItShouldMatchContainedElementsWithHamcrestMatcher
  64
+- (void)testItShouldMatchContainedElementsWithGenericMatcher
65 65
 {
66 66
     id subject = [NSArray arrayWithObjects:@"dog", @"cat", @"tiger", @"liger", nil];
67 67
     id matcher = [KWContainMatcher matcherWithSubject:subject];
@@ -69,7 +69,7 @@ - (void)testItShouldMatchContainedElementsWithHamcrestMatcher
69 69
     STAssertTrue([matcher evaluate], @"expected positive match");
70 70
 }
71 71
 
72  
-- (void)testItShouldNotMatchContainedElementsWithHamcrestMatcher
  72
+- (void)testItShouldNotMatchContainedElementsWithGenericMatcher
73 73
 {
74 74
     id subject = [NSArray arrayWithObjects:@"dog", @"cat", @"tiger", @"liger", nil];
75 75
     id matcher = [KWContainMatcher matcherWithSubject:subject];
16  Tests/KWHamcrestMatcherTest.m → Tests/KWGenericMatcherTest.m
... ...
@@ -1,5 +1,5 @@
1 1
 //
2  
-//  KWHamcrestMatcherTest.m
  2
+//  KWGenericMatcherTest.m
3 3
 //  Kiwi
4 4
 //
5 5
 //  Created by Luke Redpath on 24/01/2011.
@@ -12,29 +12,29 @@
12 12
 
13 13
 #if KW_TESTS_ENABLED
14 14
 
15  
-@interface KWHamcrestMatcherTest : SenTestCase
  15
+@interface KWGenericMatcherTest : SenTestCase
16 16
 
17 17
 @end
18 18
 
19  
-@implementation KWHamcrestMatcherTest
  19
+@implementation KWGenericMatcherTest
20 20
 
21  
-- (void)testItShouldMatchObjectsThatMatchHamcrestMatchers
  21
+- (void)testItShouldMatchObjectsThatMatchGenericMatchers
22 22
 {
23  
-    id matcher = [KWHamcrestMatcher matcherWithSubject:@"Alpha Bravo"];
  23
+    id matcher = [KWGenericMatcher matcherWithSubject:@"Alpha Bravo"];
24 24
     [matcher match:hasPrefix(@"Alpha")];
25 25
     STAssertTrue([matcher evaluate], @"expected positive match");
26 26
 }
27 27
 
28  
-- (void)testItShouldNotMatchObjectsThatMatchHamcrestMatchers
  28
+- (void)testItShouldNotMatchObjectsThatMatchGenericMatchers
29 29
 {
30  
-    id matcher = [KWHamcrestMatcher matcherWithSubject:@"Charlie Bravo"];
  30
+    id matcher = [KWGenericMatcher matcherWithSubject:@"Charlie Bravo"];
31 31
     [matcher match:hasPrefix(@"Alpha")];
32 32
     STAssertFalse([matcher evaluate], @"expected negative match");
33 33
 }
34 34
 
35 35
 - (void)testItShouldHaveHumanReadableDescription
36 36
 {
37  
-    id matcher = [KWHamcrestMatcher matcherWithSubject:nil];
  37
+    id matcher = [KWGenericMatcher matcherWithSubject:nil];
38 38
     [matcher match:hasPrefix(@"Alpha")];
39 39
     STAssertEqualObjects(@"match a string with prefix 'Alpha'", [matcher description], @"description should match");
40 40
 }
4  Tests/KWHaveValueMatcherTest.m
@@ -47,14 +47,14 @@ - (void)testItShouldNotMatchValuesUsingKeyPaths {
47 47
     STAssertFalse([matcher evaluate], @"expected negative match");
48 48
 }
49 49
 
50  
-- (void)testItShouldMatchValuesMatchUsingKeyValueCodingAndHamcrestMatcher {
  50
+- (void)testItShouldMatchValuesMatchUsingKeyValueCodingAndGenericMatcher {
51 51
     id subject = [Cruiser cruiserWithCallsign:@"Alpha Bravo Zero"];
52 52
     id matcher = [KWHaveValueMatcher matcherWithSubject:subject];
53 53
     [matcher haveValue:hasPrefix(@"Alpha") forKey:@"callsign"];
54 54
     STAssertTrue([matcher evaluate], @"expected positive match");
55 55
 }
56 56
 
57  
-- (void)testItShouldNotMatchValuesMatchUsingKeyValueCodingAndHamcrestMatcher {
  57
+- (void)testItShouldNotMatchValuesMatchUsingKeyValueCodingAndGenericMatcher {
58 58
     id subject = [Cruiser cruiserWithCallsign:@"Alpha Bravo Zero"];
59 59
     id matcher = [KWHaveValueMatcher matcherWithSubject:subject];
60 60
     [matcher haveValue:hasPrefix(@"Foxtrot") forKey:@"callsign"];
13  Tests/KWValueTest.m
@@ -19,47 +19,48 @@ - (void)testItShouldPreserveDataObjCTypeForInts {
19 19
     int value = 42;
20 20
     KWValue *wrappedValue = [KWValue valueWithBytes:&value objCType:@encode(int)];
21 21
     const char *objCType = [wrappedValue objCType];
22  
-    STAssertTrue(objCType != nil, @"expected value to return valid Objective-C type");
23 22
     STAssertTrue(strcmp(objCType, @encode(int)) == 0, @"expected value to preserve Objective-C type for ints");
  23
+    STAssertTrue(objCType != nil, @"expected value to return valid Objective-C type");
24 24
 }
25 25
 
26 26
 - (void)testItShouldPreserveDataObjCTypeForUnsignedInts {
27 27
     unsigned int value = 42;
28 28
     KWValue *wrappedValue = [KWValue valueWithBytes:&value objCType:@encode(unsigned int)];
29 29
     const char *objCType = [wrappedValue objCType];
30  
-    STAssertTrue(objCType != nil, @"expected value to return valid Objective-C type");
31 30
     STAssertTrue(strcmp(objCType, @encode(unsigned int)) == 0, @"expected value to preserve Objective-C type for unsigned ints");
  31
+    STAssertTrue(objCType != nil, @"expected value to return valid Objective-C type");
32 32
 }
33 33
 
34 34
 - (void)testItShouldPreserveDataObjCTypeForLongs {
35 35
     long value = 42;
36 36
     KWValue *wrappedValue = [KWValue valueWithBytes:&value objCType:@encode(long)];
37 37
     const char *objCType = [wrappedValue objCType];
38  
-    STAssertTrue(objCType != nil, @"expected value to return valid Objective-C type");
39 38
     STAssertTrue(strcmp(objCType, @encode(long)) == 0, @"expected value to preserve Objective-C type for longs");
  39
+    STAssertTrue(objCType != nil, @"expected value to return valid Objective-C type");
40 40
 }
41 41
 
42 42
 - (void)testItShouldPreserveDataObjCTypeForUnsignedLongs {
43 43
     unsigned long value = 42;
44 44
     KWValue *wrappedValue = [KWValue valueWithBytes:&value objCType:@encode(unsigned long)];
45 45
     const char *objCType = [wrappedValue objCType];
  46
+    STAssertTrue(strcmp(objCType, @encode(unsigned long)) == 0, @"expected value to preserve Objective-C type for unsigned longs");
46 47
     STAssertTrue(objCType != nil, @"expected value to return valid Objective-C type");
47  
-    STAssertTrue(strcmp(objCType, @encode(unsigned long)) == 0, @"expected value to preserve Objective-C type for unsigned longs");}
  48
+}
48 49
 
49 50
 - (void)testItShouldPreserveDataObjCTypeForFloats {
50 51
     float value = 42.0f;
51 52
     KWValue *wrappedValue = [KWValue valueWithBytes:&value objCType:@encode(float)];
52 53
     const char *objCType = [wrappedValue objCType];
53  
-    STAssertTrue(objCType != nil, @"expected value to return valid Objective-C type");
54 54
     STAssertTrue(strcmp(objCType, @encode(float)) == 0, @"expected value to preserve Objective-C type for floats");
  55
+    STAssertTrue(objCType != nil, @"expected value to return valid Objective-C type");
55 56
 }
56 57
 
57 58
 - (void)testItShouldPreserveDataObjCTypeForDoubles {
58 59
     double value = 42.0f;
59 60
     KWValue *wrappedValue = [KWValue valueWithBytes:&value objCType:@encode(double)];
60 61
     const char *objCType = [wrappedValue objCType];
61  
-    STAssertTrue(objCType != nil, @"expected value to return valid Objective-C type");
62 62
     STAssertTrue(strcmp(objCType, @encode(double)) == 0, @"expected value to preserve Objective-C type for doubles");
  63
+    STAssertTrue(objCType != nil, @"expected value to return valid Objective-C type");
63 64
 }
64 65
 
65 66
 - (void)testItShouldConvertToIntValues {

0 notes on commit 0080ba5

Please sign in to comment.
Something went wrong with that request. Please try again.