Skip to content

Commit 640e39e

Browse files
committed
feat(Meta): Add test for case with conflict
1 parent e763451 commit 640e39e

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

src/test/groovy/ru/endlesscode/bukkitgradle/meta/task/MergePluginMetaSpec.groovy

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,4 +234,33 @@ class MergePluginMetaSpec extends PluginSpecification {
234234
api-version: "1.16"
235235
""".stripIndent().trim()
236236
}
237+
238+
void 'when merge meta - and there are conflicting fields in source and in build script - should prefer values from build script'() {
239+
given: "source meta file with extra fields"
240+
sourceMetaFile << """
241+
name: SourceValue
242+
version: 1.2
243+
""".stripIndent()
244+
245+
and: "conflicting gields in build script"
246+
buildFile << """
247+
bukkit {
248+
meta {
249+
name.set("BuildscriptValue")
250+
version.set("1.3")
251+
}
252+
}
253+
""".stripIndent()
254+
255+
when: "run processResources"
256+
run(TASK_PATH, "--stacktrace")
257+
258+
then: "should write meta and prefer source fields"
259+
metaFile.text == """\
260+
main: "com.example.testplugin.BuildscriptValue"
261+
name: "BuildscriptValue"
262+
version: "1.3"
263+
api-version: "1.16"
264+
""".stripIndent().trim()
265+
}
237266
}

0 commit comments

Comments
 (0)