Skip to content

Commit 8e8abb4

Browse files
committed
fix: Update indentation in tests
1 parent 0ba7634 commit 8e8abb4

File tree

2 files changed

+68
-66
lines changed

2 files changed

+68
-66
lines changed

build.gradle.kts

+3-1
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,10 @@ kotlin {
1616
}
1717
}
1818

19-
tasks.test.configure {
19+
tasks.test {
2020
useJUnitPlatform()
21+
22+
jvmArgs("--add-opens=java.base/java.nio.charset=ALL-UNNAMED")
2123
}
2224

2325
repositories {

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

+65-65
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,12 @@ class MergePluginMetaSpec extends PluginSpecification {
5252
run(TASK_PATH)
5353

5454
then: "meta file content corresponds to default config"
55-
metaFile.text == """\
56-
main: "com.example.testplugin.TestPlugin"
57-
name: "test-plugin"
58-
version: "1.0"
59-
api-version: "1.16"
60-
""".stripIndent().trim()
55+
metaFile.text == """
56+
main: "com.example.testplugin.TestPlugin"
57+
name: "test-plugin"
58+
version: "1.0"
59+
api-version: "1.16"
60+
""".stripIndent().trim()
6161
}
6262

6363
def 'when merge meta - and generate it again - should skip second task run'() {
@@ -85,13 +85,13 @@ class MergePluginMetaSpec extends PluginSpecification {
8585
taskOutcome(TASK_PATH) == TaskOutcome.SUCCESS
8686

8787
and: "meta generated with new description"
88-
metaFile.text == """\
89-
main: "com.example.testplugin.TestPlugin"
90-
name: "test-plugin"
91-
description: "Plugin can has description"
92-
version: "1.0"
93-
api-version: "1.16"
94-
""".stripIndent().trim()
88+
metaFile.text == """
89+
main: "com.example.testplugin.TestPlugin"
90+
name: "test-plugin"
91+
description: "Plugin can has description"
92+
version: "1.0"
93+
api-version: "1.16"
94+
""".stripIndent().trim()
9595
}
9696

9797
void 'when merge meta - and all properties configured - should write all lines'() {
@@ -115,15 +115,15 @@ class MergePluginMetaSpec extends PluginSpecification {
115115
run(TASK_PATH)
116116

117117
then: "should write all lines"
118-
metaFile.text == """\
119-
main: "com.example.plugin.Plugin"
120-
name: "TestPlugin"
121-
description: "Test plugin description"
122-
version: "0.1"
123-
api-version: "1.13"
124-
authors: ["OsipXD", "Contributors"]
125-
website: "http://www.example.com/"
126-
""".stripIndent().trim()
118+
metaFile.text == """
119+
main: "com.example.plugin.Plugin"
120+
name: "TestPlugin"
121+
description: "Test plugin description"
122+
version: "0.1"
123+
api-version: "1.13"
124+
authors: ["OsipXD", "Contributors"]
125+
website: "http://www.example.com/"
126+
""".stripIndent().trim()
127127
}
128128

129129
void 'when merge meta - and all properties configured old way - should write all lines'() {
@@ -146,15 +146,15 @@ class MergePluginMetaSpec extends PluginSpecification {
146146
run(TASK_PATH)
147147

148148
then: "should write all lines"
149-
metaFile.text == """\
150-
main: "com.example.plugin.Plugin"
151-
name: "TestPlugin"
152-
description: "Test plugin description"
153-
version: "0.1"
154-
api-version: "1.16"
155-
authors: ["OsipXD", "Contributors"]
156-
website: "http://www.example.com/"
157-
""".stripIndent().trim()
149+
metaFile.text == """
150+
main: "com.example.plugin.Plugin"
151+
name: "TestPlugin"
152+
description: "Test plugin description"
153+
version: "0.1"
154+
api-version: "1.16"
155+
authors: ["OsipXD", "Contributors"]
156+
website: "http://www.example.com/"
157+
""".stripIndent().trim()
158158
}
159159

160160
void 'when merge meta - and there are extra fields in source - should write all lines'() {
@@ -173,19 +173,19 @@ class MergePluginMetaSpec extends PluginSpecification {
173173
run(TASK_PATH)
174174

175175
then: "should write meta with the extra fields"
176-
metaFile.text == """\
177-
main: "com.example.testplugin.TestPlugin"
178-
name: "test-plugin"
179-
version: "1.0"
180-
api-version: "1.16"
181-
depend: ["Vault", "ProtocolLib"]
182-
commands:
183-
"example":
184-
description: "Just a command"
185-
permissions:
186-
"example.foo":
187-
description: "My foo permission"
188-
""".stripIndent().trim()
176+
metaFile.text == """
177+
main: "com.example.testplugin.TestPlugin"
178+
name: "test-plugin"
179+
version: "1.0"
180+
api-version: "1.16"
181+
depend: ["Vault", "ProtocolLib"]
182+
commands:
183+
"example":
184+
description: "Just a command"
185+
permissions:
186+
"example.foo":
187+
description: "My foo permission"
188+
""".stripIndent().trim()
189189
}
190190

191191
// BukkitGradle-26
@@ -205,15 +205,15 @@ class MergePluginMetaSpec extends PluginSpecification {
205205
CharsetUtils.setDefaultCharset('UTF-8')
206206

207207
then:
208-
metaFile.text == """\
209-
main: "com.example.testplugin.TestPlugin"
210-
name: "test-plugin"
211-
version: "1.0"
212-
api-version: "1.16"
213-
commands:
214-
"퀘스트":
215-
description: "퀘스트 명령어 입니다."
216-
""".stripIndent().trim()
208+
metaFile.text == """
209+
main: "com.example.testplugin.TestPlugin"
210+
name: "test-plugin"
211+
version: "1.0"
212+
api-version: "1.16"
213+
commands:
214+
"퀘스트":
215+
description: "퀘스트 명령어 입니다."
216+
""".stripIndent().trim()
217217
}
218218

219219
void 'when merge meta - and there are fields in source - should prefer values from source'() {
@@ -227,12 +227,12 @@ class MergePluginMetaSpec extends PluginSpecification {
227227
run(TASK_PATH, "--stacktrace")
228228

229229
then: "should write meta and prefer source fields"
230-
metaFile.text == """\
231-
main: "com.example.testplugin.SourceValue"
232-
name: "SourceValue"
233-
version: "1.2"
234-
api-version: "1.16"
235-
""".stripIndent().trim()
230+
metaFile.text == """
231+
main: "com.example.testplugin.SourceValue"
232+
name: "SourceValue"
233+
version: "1.2"
234+
api-version: "1.16"
235+
""".stripIndent().trim()
236236
}
237237

238238
void 'when merge meta - and there are conflicting fields in source and in build script - should prefer values from build script'() {
@@ -256,11 +256,11 @@ class MergePluginMetaSpec extends PluginSpecification {
256256
run(TASK_PATH, "--stacktrace")
257257

258258
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()
259+
metaFile.text == """
260+
main: "com.example.testplugin.BuildscriptValue"
261+
name: "BuildscriptValue"
262+
version: "1.3"
263+
api-version: "1.16"
264+
""".stripIndent().trim()
265265
}
266266
}

0 commit comments

Comments
 (0)