Skip to content

Commit 6759e85

Browse files
committed
Simplified the stub and expect macros.
Maybe I did too much JavaScript recently...
1 parent 48224f0 commit 6759e85

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

Source/OCMock/OCMock.h

+8-8
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,18 @@
2424

2525
#define OCMObserverMock() [OCMockObject observerMock]
2626

27-
#define OCMStub(invocation) (^ () \
28-
{ \
27+
#define OCMStub(invocation) \
28+
({ \
2929
[OCMMacroState beginStubMacro]; \
3030
invocation; \
31-
return [OCMMacroState endStubMacro]; \
32-
})()
31+
[OCMMacroState endStubMacro]; \
32+
})
3333

34-
#define OCMExpect(invocation) (^ () \
35-
{ \
34+
#define OCMExpect(invocation) \
35+
({ \
3636
[OCMMacroState beginExpectMacro]; \
3737
invocation; \
38-
return [OCMMacroState endExpectMacro]; \
39-
})()
38+
[OCMMacroState endExpectMacro]; \
39+
})
4040

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

0 commit comments

Comments
 (0)