Skip to content

Commit

Permalink
patch: test improvements (#1)
Browse files Browse the repository at this point in the history
* Improved tests
* Bump version
  • Loading branch information
Im-Fran authored Dec 21, 2023
1 parent 67de4cc commit c212dce
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion plugin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ gradlePlugin {
implementationClass = "cl.franciscosolis.gradledotenv.GradleDotEnvPlugin"
displayName = "GradleDotEnv"
description = "Gradle plugin to load environment variables from .env files"
version = "1.0.0"
version = "1.0.1"
tags = listOf("env", "dotenv", "envfile", "environment", "variables")
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,16 @@ class GradleDotEnvPluginFunctionalTest {

private val buildFile by lazy { projectDir.resolve("build.gradle") }
private val settingsFile by lazy { projectDir.resolve("settings.gradle") }
private val envFile by lazy { projectDir.resolve(".env") }

@Test
fun hasEnvExtension() {
val envs = mapOf("FOO" to "BAR", "UUID" to UUID.randomUUID().toString())
// Set up the test build
envFile.writeText("""
FOO=${envs["FOO"]}
UUID=${envs["UUID"]}
""".trimIndent())
settingsFile.writeText("")
buildFile.writeText("""
plugins {
Expand All @@ -31,8 +37,6 @@ class GradleDotEnvPluginFunctionalTest {
println("FOO=${'$'}{env.FOO}")
""".trimIndent())

val envs = mapOf("FOO" to "BAR", "UUID" to UUID.randomUUID().toString())

// Run the build
val runner = GradleRunner.create()
runner.forwardOutput()
Expand Down

0 comments on commit c212dce

Please sign in to comment.