Skip to content

Commit 09712e7

Browse files
committed
Update test
1 parent 7ece533 commit 09712e7

File tree

2 files changed

+10
-11
lines changed

2 files changed

+10
-11
lines changed

src/test/kotlin/com/tomwyr/GeneratorTest.kt

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
package com.tomwyr
22

3-
import com.tomwyr.generator.NodeTreeGenerator
4-
import com.tomwyr.utils.GodotKotlinProject
3+
import com.tomwyr.command.GenerateTreeCommand
54
import java.io.File
6-
import kotlin.test.BeforeTest
75
import kotlin.test.Test
86
import kotlin.test.assertEquals
97

@@ -34,10 +32,10 @@ class GeneratorTest {
3432
}
3533
}
3634

37-
fun test(testCase: String, targetPackage: String) {
35+
fun test(testCase: String, packageName: String) {
3836
try {
39-
val project = setUpTestProject(testCase, targetPackage)
40-
NodeTreeGenerator().generate(project)
37+
val command = setUpTestCommand(testCase, packageName)
38+
command.run()
4139
assertOutputsEqual(testCase)
4240
} finally {
4341
cleanUpGeneratedOutput(testCase)
@@ -46,11 +44,12 @@ fun test(testCase: String, targetPackage: String) {
4644

4745
const val basePath = "src/test/resources/"
4846

49-
fun setUpTestProject(testCase: String, targetPackage: String): GodotKotlinProject {
50-
return GodotKotlinProject(
51-
"$basePath/$testCase/scenes",
52-
"$basePath/$testCase/Actual",
53-
targetPackage,
47+
fun setUpTestCommand(testCase: String, packageName: String): GenerateTreeCommand {
48+
return GenerateTreeCommand(
49+
libPath = "NodeTreeGenerator.dylib",
50+
projectPath = "$basePath/$testCase/scenes",
51+
outputPath = "$basePath/$testCase/Actual",
52+
packageName = packageName,
5453
)
5554
}
5655

463 KB
Binary file not shown.

0 commit comments

Comments
 (0)