Skip to content

Commit

Permalink
Simplified the stub and expect macros.
Browse files Browse the repository at this point in the history
Maybe I did too much JavaScript recently...
  • Loading branch information
erikdoe committed Apr 25, 2014
1 parent 48224f0 commit 6759e85
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions Source/OCMock/OCMock.h
Expand Up @@ -24,18 +24,18 @@

#define OCMObserverMock() [OCMockObject observerMock]

#define OCMStub(invocation) (^ () \
{ \
#define OCMStub(invocation) \
({ \
[OCMMacroState beginStubMacro]; \
invocation; \
return [OCMMacroState endStubMacro]; \
})()
[OCMMacroState endStubMacro]; \
})

#define OCMExpect(invocation) (^ () \
{ \
#define OCMExpect(invocation) \
({ \
[OCMMacroState beginExpectMacro]; \
invocation; \
return [OCMMacroState endExpectMacro]; \
})()
[OCMMacroState endExpectMacro]; \
})

#define OCMVerifyAll(mock) [mock verifyAtLocation:OCMMakeLocation(self, __FILE__, __LINE__)]

0 comments on commit 6759e85

Please sign in to comment.