locked.properties now created in user.home (NTFS/FAT32 workaround)
This commit is contained in:
parent
e71f4f60ee
commit
34cedc21e6
1 changed files with 212 additions and 207 deletions
|
@ -36,14 +36,15 @@ import org.gradle.api.GradleException
|
|||
import org.spekframework.spek2.Spek
|
||||
import org.spekframework.spek2.style.gherkin.Feature
|
||||
import java.io.File
|
||||
import java.util.Properties
|
||||
import java.util.*
|
||||
import kotlin.test.assertEquals
|
||||
import kotlin.test.assertFailsWith
|
||||
import kotlin.test.assertNull
|
||||
import kotlin.test.assertTrue
|
||||
|
||||
@Suppress("unused")
|
||||
object UtilsSpec : Spek({
|
||||
object UtilsSpec : Spek(
|
||||
{
|
||||
Feature("Utils") {
|
||||
val version = Version()
|
||||
val config = SemverConfig(version)
|
||||
|
@ -96,7 +97,10 @@ object UtilsSpec : Spek({
|
|||
assertTrue(
|
||||
Utils.isNotSystemProperty(
|
||||
setOf(
|
||||
config.majorKey, config.minorKey, config.patchKey, config.preReleaseKey,
|
||||
config.majorKey,
|
||||
config.minorKey,
|
||||
config.patchKey,
|
||||
config.preReleaseKey,
|
||||
config.buildMetaKey
|
||||
)
|
||||
)
|
||||
|
@ -221,7 +225,7 @@ object UtilsSpec : Spek({
|
|||
Scenario("Save to locked properties") {
|
||||
lateinit var propsLocked: File
|
||||
Given("the locked properties") {
|
||||
propsLocked = File("locked.properties")
|
||||
propsLocked = File(System.getProperty("user.home") + File.separator + "locked.properties")
|
||||
propsLocked.createNewFile()
|
||||
propsLocked.setReadOnly()
|
||||
config.properties = propsLocked.name
|
||||
|
@ -229,7 +233,7 @@ object UtilsSpec : Spek({
|
|||
|
||||
Then("saving the locked properties file") {
|
||||
assertFailsWith<GradleException> {
|
||||
Utils.saveProperties(projectDir, config, version)
|
||||
Utils.saveProperties(propsLocked.parentFile, config, version)
|
||||
}
|
||||
propsLocked.delete()
|
||||
}
|
||||
|
@ -261,4 +265,5 @@ object UtilsSpec : Spek({
|
|||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue