File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
src/test/groovy/ch/petikoch/examples/mvvm_rxjava/utils Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -73,15 +73,19 @@ class AsyncUtilsTest extends Specification {
7373 }
7474
7575 def ' executeAsync: propagates exceptions' () {
76+ given :
77+ def evilExceptionAtRuntime = new RuntimeException (" Boom!" )
78+
7679 when :
7780 Single<FinishedIndicator > result = AsyncUtils . executeAsync {
78- throw new RuntimeException ( " Boom! " )
81+ throw evilExceptionAtRuntime
7982 }
8083 result. subscribe(testSubscriber)
8184 awaitUntil { ! testSubscriber. getOnErrorEvents(). isEmpty() }
8285
8386 then :
84- testSubscriber. assertError(RuntimeException )
87+ testSubscriber. getOnErrorEvents(). size() == 1
88+ testSubscriber. getOnErrorEvents(). get(0 ). is(evilExceptionAtRuntime)
8589 testSubscriber. assertNoValues()
8690 }
8791
You can’t perform that action at this time.
0 commit comments