rewrite icon indicating copy to clipboard operation
rewrite copied to clipboard

GroovyRecipeTest - dependsOn not taken into account

Open thomaszub opened this issue 3 years ago • 1 comments

Hi,

I have problems executing a test for a Groovy recipe. It looks like the dependsOn part is not evaluated:

class JenkinsfileRecipeTest : GroovyRecipeTest {

    @Test
    fun base() = assertUnchanged(
        recipe = JenkinsfileRecipe(),
        dependsOn = arrayOf(
                    """
                        interface Library {
                            String value()
                        }
                    """.trimIndent()
        ),
        before = """
                #!groovy
                class Test implements Library {
                    String value() {
                        "Hello"
                    }
                }
                
                print "Hello"
            """.trimIndent(),
    )
}

The recipe is just a stub:

public class JenkinsfileRecipe extends Recipe {

    @Override
    public @NotNull String getDisplayName() {
        return "Something about Jenkinsfile";
    }

    @Override
    public @NotNull String getDescription() {
        return "Something about Jenkinsfile.";
    }

}

Kind regards Thomas

thomaszub avatar Jun 27 '22 06:06 thomaszub

@thomaszub thanks for the report, we'll fix this as soon as we can!

traceyyoshima avatar Jun 28 '22 20:06 traceyyoshima

This is not an issue with RewriteTest, the successor to all of the <language>RecipeTest classes. GroovyRecipeTest will not be fixed, but will eventually be deleted outright

sambsnyd avatar Nov 07 '22 23:11 sambsnyd