Created
May 22, 2014 18:31
-
-
Save shaps80/748693e2a43357d06789 to your computer and use it in GitHub Desktop.
The following is the test I have written but it never asserts from my tests. I think the issue is that the assertion occurs on a different thread that the one that the task is performed on, that perhaps this isn't getting back to the test.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
it (@"should eventually throw assert for asynchronous operation", ^{ | |
[[theBlock(^{ | |
[MyClass performLongRunningAsynchronousTasks]; | |
}) shouldEventually] raise]; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I don't think you can do this at all, an exception is per thread. To my knowledge exceptions stay on the thread they were executed from, thus you can't capture it here.