diff --git a/spock-specs/src/test/groovy/org/spockframework/smoke/ast/AstSpec.groovy b/spock-specs/src/test/groovy/org/spockframework/smoke/ast/AstSpec.groovy index dac58bb30c..c822036ce4 100644 --- a/spock-specs/src/test/groovy/org/spockframework/smoke/ast/AstSpec.groovy +++ b/spock-specs/src/test/groovy/org/spockframework/smoke/ast/AstSpec.groovy @@ -344,30 +344,10 @@ class Ext { snapshotter.assertThat(result.source).matchesSnapshot() } - @Requires({ GroovyRuntimeUtil.groovy4orNewer }) - def "Primitive types are used in AST transformation Groovy >= 4"() { - when: - def result = compiler.transpileWithImports(''' -class TestSpec extends Specification { - def 'test'() { - expect: - true - when: - true - then: - thrown(RuntimeException) - } -} -''', - EnumSet.of(Show.METHODS), - CompilePhase.OUTPUT) - - then: - textSnapshotter.assertThat(result.source).matchesSnapshot() - } + def "Primitive types are used in AST transformation"() { + given: + def snapshotId = GroovyRuntimeUtil.groovy4orNewer ? "groovy4" : "" - @Requires({ GroovyRuntimeUtil.groovy3orOlder }) - def "Primitive types are used in AST transformation Groovy <= 3"() { when: def result = compiler.transpileWithImports(''' class TestSpec extends Specification { @@ -385,6 +365,6 @@ class TestSpec extends Specification { CompilePhase.OUTPUT) then: - textSnapshotter.assertThat(result.source).matchesSnapshot() + textSnapshotter.assertThat(result.source).matchesSnapshot(snapshotId) } } diff --git a/spock-specs/src/test/resources/snapshots/org/spockframework/smoke/ast/AstSpec/Primitive_types_are_used_in_AST_transformation_Groovy____4.txt b/spock-specs/src/test/resources/snapshots/org/spockframework/smoke/ast/AstSpec/Primitive_types_are_used_in_AST_transformation-groovy4.txt similarity index 100% rename from spock-specs/src/test/resources/snapshots/org/spockframework/smoke/ast/AstSpec/Primitive_types_are_used_in_AST_transformation_Groovy____4.txt rename to spock-specs/src/test/resources/snapshots/org/spockframework/smoke/ast/AstSpec/Primitive_types_are_used_in_AST_transformation-groovy4.txt diff --git a/spock-specs/src/test/resources/snapshots/org/spockframework/smoke/ast/AstSpec/Primitive_types_are_used_in_AST_transformation_Groovy____3.txt b/spock-specs/src/test/resources/snapshots/org/spockframework/smoke/ast/AstSpec/Primitive_types_are_used_in_AST_transformation.txt similarity index 100% rename from spock-specs/src/test/resources/snapshots/org/spockframework/smoke/ast/AstSpec/Primitive_types_are_used_in_AST_transformation_Groovy____3.txt rename to spock-specs/src/test/resources/snapshots/org/spockframework/smoke/ast/AstSpec/Primitive_types_are_used_in_AST_transformation.txt