diff --git a/modules/nextflow/build.gradle b/modules/nextflow/build.gradle index a71409a676..dd735887c4 100644 --- a/modules/nextflow/build.gradle +++ b/modules/nextflow/build.gradle @@ -61,8 +61,8 @@ dependencies { testFixturesApi ("org.apache.groovy:groovy-test:4.0.29") { exclude group: 'org.apache.groovy' } testFixturesApi ("org.objenesis:objenesis:3.4") testFixturesApi ("net.bytebuddy:byte-buddy:1.14.17") - testFixturesApi ("org.spockframework:spock-core:2.3-groovy-4.0") { exclude group: 'org.apache.groovy' } - testFixturesApi ('org.spockframework:spock-junit4:2.3-groovy-4.0') { exclude group: 'org.apache.groovy' } + testFixturesApi ("org.spockframework:spock-core:2.4-groovy-4.0") { exclude group: 'org.apache.groovy' } + testFixturesApi ('org.spockframework:spock-junit4:2.4-groovy-4.0') { exclude group: 'org.apache.groovy' } testFixturesApi 'com.google.jimfs:jimfs:1.2' // note: declare as separate dependency to avoid a circular dependency lineageImplementation (project(':nf-lineage')) diff --git a/modules/nextflow/src/test/groovy/nextflow/processor/TaskRunTest.groovy b/modules/nextflow/src/test/groovy/nextflow/processor/TaskRunTest.groovy index 6cfee6bbc0..e057a80e29 100644 --- a/modules/nextflow/src/test/groovy/nextflow/processor/TaskRunTest.groovy +++ b/modules/nextflow/src/test/groovy/nextflow/processor/TaskRunTest.groovy @@ -882,11 +882,13 @@ class TaskRunTest extends Specification { !task.isArray() } + // note: use `stubRun >> value` instead of `getStubRun() >> value` because + // Spock 2.4 requires property stubbing for direct property access (session.stubRun) def 'should resolve task body' () { given: def task = Spy(TaskRun) task.processor = Mock(TaskProcessor) { - getSession()>>Mock(Session) { getStubRun() >> false} + getSession()>>Mock(Session) { stubRun >> false} } and: def body = Mock(BodyDef) @@ -902,7 +904,7 @@ class TaskRunTest extends Specification { given: def task = Spy(TaskRun) task.processor = Mock(TaskProcessor) { - getSession()>>Mock(Session) { getStubRun() >> true} + getSession()>>Mock(Session) { stubRun >> true} } task.config = Mock(TaskConfig) { getStubBlock()>> null } and: @@ -923,7 +925,7 @@ class TaskRunTest extends Specification { def task = Spy(TaskRun) task.config = Mock(TaskConfig) { getStubBlock()>>stub } task.processor = Mock(TaskProcessor) { - getSession()>>Mock(Session) { getStubRun() >> true} + getSession()>>Mock(Session) { stubRun >> true} } when: