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 {
73
73
}
74
74
75
75
def ' executeAsync: propagates exceptions' () {
76
+ given :
77
+ def evilExceptionAtRuntime = new RuntimeException (" Boom!" )
78
+
76
79
when :
77
80
Single<FinishedIndicator > result = AsyncUtils . executeAsync {
78
- throw new RuntimeException ( " Boom! " )
81
+ throw evilExceptionAtRuntime
79
82
}
80
83
result. subscribe(testSubscriber)
81
84
awaitUntil { ! testSubscriber. getOnErrorEvents(). isEmpty() }
82
85
83
86
then :
84
- testSubscriber. assertError(RuntimeException )
87
+ testSubscriber. getOnErrorEvents(). size() == 1
88
+ testSubscriber. getOnErrorEvents(). get(0 ). is(evilExceptionAtRuntime)
85
89
testSubscriber. assertNoValues()
86
90
}
87
91
You can’t perform that action at this time.
0 commit comments