Skip to content

Commit f717eaa

Browse files
author
Erik Strid
committed
Call all setup/cleanup methods in super specs when retrying
1 parent a2ba58a commit f717eaa

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

src/main/groovy/com/anotherchrisberry/spock/extensions/retry/RetryInterceptor.groovy

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,18 @@ class RetryInterceptor implements IMethodInterceptor {
2929
if (attempts > retryMax) {
3030
throw t
3131
}
32-
invocation.spec.cleanupMethods.each {
33-
if (it.reflection) {
34-
ReflectionUtil.invokeMethod(invocation.target, it.reflection)
32+
invocation.spec.specsBottomToTop.each { spec ->
33+
spec.cleanupMethods.each {
34+
if (it.reflection) {
35+
ReflectionUtil.invokeMethod(invocation.target, it.reflection)
36+
}
3537
}
3638
}
37-
invocation.spec.setupMethods.each {
38-
if (it.reflection) {
39-
ReflectionUtil.invokeMethod(invocation.target, it.reflection)
39+
invocation.spec.specsTopToBottom.each { spec ->
40+
spec.setupMethods.each {
41+
if (it.reflection) {
42+
ReflectionUtil.invokeMethod(invocation.target, it.reflection)
43+
}
4044
}
4145
}
4246
}

0 commit comments

Comments
 (0)