Skip to content

Commit

Permalink
Merge pull request #1 from lnnery/bugfix/error_processing_plugins_wit…
Browse files Browse the repository at this point in the history
…h_variables

Update FindPluginsTest.java
  • Loading branch information
lnnery authored Jan 10, 2024
2 parents fb7dbd6 + 5bbdecf commit f034d11
Showing 1 changed file with 32 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,36 @@ void findPlugin() {
)
);
}

@Test
void findPluginWithVariable() {
rewriteRun(
buildGradle(
"""
plugins {
id 'com.jfrog.bintray'
id 'com.jfrog.bintray' version "${jfrogBintrayVersion}"
}
""",
"""
plugins {
/*~~>*/id 'com.jfrog.bintray'
/*~~>*/id 'com.jfrog.bintray' version "${jfrogBintrayVersion}"
}
""",
spec -> spec.beforeRecipe(cu -> assertThat(FindPlugins.find(cu, "com.jfrog.bintray"))
.isNotEmpty()
.anySatisfy(p -> {
assertThat(p.getPluginId()).isEqualTo("com.jfrog.bintray");
assertThat(p.getVersion()).isEqualTo("1.8.5");
}))
),
properties(
"""
jfrogBintrayVersion=1.8.5
""",
spec -> spec.path("gradle.properties")
)
);
}
}

0 comments on commit f034d11

Please sign in to comment.