From 8c2079929508e3f2f1933139838edea711d39c5c Mon Sep 17 00:00:00 2001 From: Paolo Di Tommaso Date: Sat, 27 Jul 2024 12:12:32 +0200 Subject: [PATCH] Add tests [ci fast] Signed-off-by: Paolo Di Tommaso --- .../nextflow/script/ScriptDslTest.groovy | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/modules/nextflow/src/test/groovy/nextflow/script/ScriptDslTest.groovy b/modules/nextflow/src/test/groovy/nextflow/script/ScriptDslTest.groovy index 9e48c8e55e..3758ad497a 100644 --- a/modules/nextflow/src/test/groovy/nextflow/script/ScriptDslTest.groovy +++ b/modules/nextflow/src/test/groovy/nextflow/script/ScriptDslTest.groovy @@ -604,4 +604,26 @@ class ScriptDslTest extends Dsl2Spec { result.val == 'Hello' } + + def 'should throw an exception on missing method' () { + + when: + dsl_eval ''' + Channel.doesNotExist() + ''' + then: + def e1 = thrown(MissingMethodException) + e1.message == 'No signature of method: java.lang.Object.Channel.doesNotExist() is applicable for argument types: () values: []' + + when: + dsl_eval ''' + workflow { + Channel.doesNotExist() + } + ''' + then: + def e2 = thrown(MissingProcessException) + e2.message == 'Missing process or function Channel.doesNotExist()' + } + }