-
Notifications
You must be signed in to change notification settings - Fork 607
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
.andThrow(anException) will not throw the provided anException #538
Comments
You're reading too much into what's printed. Yes, at some point that exception is thrown in the code you found, but that exception get's caught and unwrapped later: ocmock/Source/OCMock/OCMockObject.m Lines 388 to 403 in 7f6e9e9
There's a unit test that shows the correct behaviour: ocmock/Source/OCMockTests/OCMockObjectMacroTests.m Lines 251 to 258 in 7f6e9e9
In your dummy, please check what exception is actually thrown. |
Based on the documentation:
However it seems like a special exception is thrown instead of the provided one, the provided one is wrapped inside the
userInfo
ocmock/Source/OCMock/OCMExceptionReturnValueProvider.m
Lines 20 to 30 in 4e8ba16
Repro
The printed message will be
exception OCMStubbedException Exception stubbed in test
instead ofexception name reason
.The text was updated successfully, but these errors were encountered: