mirror of
https://github.com/ethauvin/kobalt.git
synced 2025-04-26 00:17:11 -07:00
Formatting.
This commit is contained in:
parent
0cbf9197e9
commit
11d3b9fd8e
1 changed files with 14 additions and 13 deletions
|
@ -12,19 +12,6 @@ import java.io.File
|
|||
|
||||
class InstallTest @Inject constructor(compilerFactory: BuildFileCompiler.IFactory) : BaseTest(compilerFactory) {
|
||||
|
||||
private fun toPath(s: String) = "\"\${project.directory}/$s\""
|
||||
private fun from(path: String) = "from(" + toPath(path) + ")"
|
||||
private fun to(path: String) = "to(" + toPath(path) + ")"
|
||||
private fun include(s1: String, s2: String, s3: String) = "include(from(" + toPath(s1) + "), " +
|
||||
"to(" + toPath(s2) + "), " + s3 + ")"
|
||||
|
||||
private fun assertFile(lpr: LaunchProjectResult, path: String, content: String) {
|
||||
File(lpr.projectDescription.file.absolutePath, path).let { file ->
|
||||
assertThat(file).exists()
|
||||
assertThat(file.readText()).isEqualTo(content)
|
||||
}
|
||||
}
|
||||
|
||||
@Test(description = "Test that copy() and include() work properly")
|
||||
fun shouldInstall() {
|
||||
val from = from("testFile")
|
||||
|
@ -46,4 +33,18 @@ class InstallTest @Inject constructor(compilerFactory: BuildFileCompiler.IFactor
|
|||
assertFile(result, "installed/testFile", testFileContent)
|
||||
assertFile(result, "deployed2/b/c", cContent)
|
||||
}
|
||||
|
||||
|
||||
private fun toPath(s: String) = "\"\${project.directory}/$s\""
|
||||
private fun from(path: String) = "from(" + toPath(path) + ")"
|
||||
private fun to(path: String) = "to(" + toPath(path) + ")"
|
||||
private fun include(s1: String, s2: String, s3: String) = "include(from(" + toPath(s1) + "), " +
|
||||
"to(" + toPath(s2) + "), " + s3 + ")"
|
||||
|
||||
private fun assertFile(lpr: LaunchProjectResult, path: String, content: String) {
|
||||
File(lpr.projectDescription.file.absolutePath, path).let { file ->
|
||||
assertThat(file).exists()
|
||||
assertThat(file.readText()).isEqualTo(content)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue