Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename "wasUsed" to "ocm_wasUsed" #429

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Source/OCMock/OCMExpectationRecorder.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@

#import <OCMock/OCMock.h>

// NB Any new methods in this class should be prefixed with `ocm_` to prevent potential clashes with
// methods that are being stubbed in mock objects by clients.
@interface OCMExpectationRecorder : OCMStubRecorder

- (id)never;
Expand Down
4 changes: 2 additions & 2 deletions Source/OCMock/OCMMacroState.m
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ + (OCMStubRecorder *)endStubMacro
OCMStubRecorder *recorder = [[(OCMStubRecorder *)[globalState recorder] retain] autorelease];
BOOL didThrow = [globalState invocationDidThrow];
[threadDictionary removeObjectForKey:OCMGlobalStateKey];
if(didThrow == NO && [recorder wasUsed] == NO)
if(didThrow == NO && [recorder ocm_wasUsed] == NO)
{
[NSException raise:NSInternalInconsistencyException
format:@"Did not record an invocation in OCMStub/OCMExpect/OCMReject.\n"
Expand Down Expand Up @@ -106,7 +106,7 @@ + (void)endVerifyMacro
OCMVerifier *verifier = [[(OCMVerifier *)[globalState recorder] retain] autorelease];
BOOL didThrow = [globalState invocationDidThrow];
[threadDictionary removeObjectForKey:OCMGlobalStateKey];
if(didThrow == NO && [verifier wasUsed] == NO)
if(didThrow == NO && [verifier ocm_wasUsed] == NO)
{
[NSException raise:NSInternalInconsistencyException
format:@"Did not record an invocation in OCMVerify.\n"
Expand Down
2 changes: 1 addition & 1 deletion Source/OCMock/OCMObserverRecorder.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@

- (BOOL)argument:(id)expectedArg matchesArgument:(id)observedArg;

- (BOOL)wasUsed;
- (BOOL)ocm_wasUsed;

@end
2 changes: 1 addition & 1 deletion Source/OCMock/OCMObserverRecorder.m
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ - (void)dealloc
[super dealloc];
}

- (BOOL)wasUsed
- (BOOL)ocm_wasUsed
{
return YES; // Needed for macro use, and recorder can only end up in macro state if it was used.
}
Expand Down
5 changes: 3 additions & 2 deletions Source/OCMock/OCMRecorder.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
@class OCMockObject;
@class OCMInvocationMatcher;


// NB Any new methods in this class should be prefixed with `ocm_` to prevent potential clashes with
// methods that are being stubbed in mock objects by clients.
@interface OCMRecorder : NSProxy
{
OCMockObject *mockObject;
Expand All @@ -36,7 +37,7 @@
- (void)setShouldReturnMockFromInit:(BOOL)flag;

- (OCMInvocationMatcher *)invocationMatcher;
- (BOOL)wasUsed;
- (BOOL)ocm_wasUsed;

- (id)classMethod;
- (id)ignoringNonObjectArgs;
Expand Down
2 changes: 1 addition & 1 deletion Source/OCMock/OCMRecorder.m
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ - (OCMInvocationMatcher *)invocationMatcher
return invocationMatcher;
}

- (BOOL)wasUsed
- (BOOL)ocm_wasUsed
{
return wasUsed;
}
Expand Down
2 changes: 2 additions & 0 deletions Source/OCMock/OCMStubRecorder.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
#import <OCMock/OCMFunctions.h>
#import <objc/runtime.h>

// NB Any new methods in this class should be prefixed with `ocm_` to prevent potential clashes with
// methods that are being stubbed in mock objects by clients.
@interface OCMStubRecorder : OCMRecorder

- (id)andReturn:(id)anObject;
Expand Down
2 changes: 2 additions & 0 deletions Source/OCMock/OCMVerifier.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
#import "OCMQuantifier.h"


// NB Any new methods in this class should be prefixed with `ocm_` to prevent potential clashes with
// methods that are being stubbed in mock objects by clients.
@interface OCMVerifier : OCMRecorder

@property(retain) OCMLocation *location;
Expand Down