OLD | NEW |
1 //------------------------------------------------------------------------------
--------- | 1 //------------------------------------------------------------------------------
--------- |
2 // $Id: OCMConstraint.m 57 2010-07-19 06:14:27Z erik $ | 2 // $Id$ |
3 // Copyright (c) 2007-2010 by Mulle Kybernetik. See License file for details. | 3 // Copyright (c) 2007-2010 by Mulle Kybernetik. See License file for details. |
4 //------------------------------------------------------------------------------
--------- | 4 //------------------------------------------------------------------------------
--------- |
5 | 5 |
6 #import <OCMock/OCMConstraint.h> | 6 #import <OCMock/OCMConstraint.h> |
7 | 7 |
8 | 8 |
9 @implementation OCMConstraint | 9 @implementation OCMConstraint |
10 | 10 |
11 + (id)constraint | 11 + (id)constraint |
12 { | 12 { |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 @end | 114 @end |
115 | 115 |
116 #pragma mark - | 116 #pragma mark - |
117 | 117 |
118 #if NS_BLOCKS_AVAILABLE | 118 #if NS_BLOCKS_AVAILABLE |
119 | 119 |
120 @implementation OCMBlockConstraint | 120 @implementation OCMBlockConstraint |
121 | 121 |
122 - (id)initWithConstraintBlock:(BOOL (^)(id))aBlock; | 122 - (id)initWithConstraintBlock:(BOOL (^)(id))aBlock; |
123 { | 123 { |
124 » [super init]; | 124 » self = [super init]; |
125 block = aBlock; | 125 block = aBlock; |
126 return self; | 126 return self; |
127 } | 127 } |
128 | 128 |
129 - (BOOL)evaluate:(id)value | 129 - (BOOL)evaluate:(id)value |
130 { | 130 { |
131 return block(value); | 131 return block(value); |
132 } | 132 } |
133 | 133 |
134 @end | 134 @end |
135 | 135 |
136 #endif | 136 #endif |
OLD | NEW |