Skip to content

Commit e220ea4

Browse files
committed
Remove +constraint method
Most constraints now require init values, so having `+constraint` is relatively useless.
1 parent fdc7e8e commit e220ea4

File tree

5 files changed

+3
-9
lines changed

5 files changed

+3
-9
lines changed

Source/OCMock/NSInvocation+OCMAdditions.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
#import "NSInvocation+OCMAdditions.h"
2121
#import "OCMFunctionsPrivate.h"
2222
#import "NSMethodSignature+OCMAdditions.h"
23-
23+
#import "OCMConstraint.h"
2424

2525
#if (TARGET_OS_OSX && (!defined(__MAC_10_10) || __MAC_OS_X_VERSION_MIN_REQUIRED < __MAC_10_10)) || \
2626
(TARGET_OS_IPHONE && (!defined(__IPHONE_8_0) || __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_8_0))

Source/OCMock/OCMArg.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ @implementation OCMArg
2525

2626
+ (id)any
2727
{
28-
return [OCMAnyConstraint constraint];
28+
return [[[OCMAnyConstraint alloc] init] autorelease];
2929
}
3030

3131
+ (void *)anyPointer

Source/OCMock/OCMConstraint.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919

2020
@interface OCMConstraint : NSObject
2121

22-
+ (instancetype)constraint;
2322
- (BOOL)evaluate:(id)value;
2423

2524
// if you are looking for any, isNil, etc, they have moved to OCMArg

Source/OCMock/OCMConstraint.m

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,6 @@
1919

2020
@implementation OCMConstraint
2121

22-
+ (instancetype)constraint
23-
{
24-
return [[[self alloc] init] autorelease];
25-
}
26-
2722
- (BOOL)evaluate:(id)value
2823
{
2924
return NO;

Source/OCMockTests/OCMConstraintTests.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ - (void)setUp
4747

4848
- (void)testAnyAcceptsAnything
4949
{
50-
OCMConstraint *constraint = [OCMAnyConstraint constraint];
50+
OCMConstraint *constraint = [[OCMAnyConstraint alloc] init];
5151
XCTAssertTrue([constraint evaluate:@"foo"], @"Should have accepted a value.");
5252
XCTAssertTrue([constraint evaluate:@"bar"], @"Should have accepted another value.");
5353
XCTAssertTrue([constraint evaluate:nil], @"Should have accepted nil.");

0 commit comments

Comments
 (0)