diff --git a/src/test/kotlin/net/thauvin/erik/gradle/semver/SemverPluginSpec.kt b/src/test/kotlin/net/thauvin/erik/gradle/semver/SemverPluginSpec.kt index ddd1621..d3ab508 100644 --- a/src/test/kotlin/net/thauvin/erik/gradle/semver/SemverPluginSpec.kt +++ b/src/test/kotlin/net/thauvin/erik/gradle/semver/SemverPluginSpec.kt @@ -1,3 +1,34 @@ +/* + * SemverVersionSpec.kt + * + * Copyright (c) 2018-2019, Erik C. Thauvin (erik@thauvin.net) + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * Neither the name of this project nor the names of its contributors may be + * used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ package net.thauvin.erik.gradle.semver import org.spekframework.spek2.Spek @@ -29,14 +60,14 @@ object SemverPluginSpec : Spek({ val props = Properties().apply { Files.newInputStream(configFile.toPath()).use { nis -> load(nis) - configFile.delete() } + configFile.delete() } assertEquals(props.getProperty(config.majorKey), version.major, "Major") assertEquals(props.getProperty(config.minorKey), version.minor, "Minor") assertEquals(props.getProperty(config.patchKey), version.patch, "Patch") - assertEquals(props.getProperty(config.preReleaseKey), version.preRelease, "PreRelease.") + assertEquals(props.getProperty(config.preReleaseKey), version.preRelease, "PreRelease") assertNull(props.getProperty(config.preReleasePrefixKey), "PreRelease Prefix") assertEquals(props.getProperty(config.buildMetaKey), version.buildMeta, "Build Meta") assertNull(props.getProperty(config.buildMetaPrefixKey), "Build Meta Prefix") diff --git a/src/test/kotlin/net/thauvin/erik/gradle/semver/SemverVersionSpec.kt b/src/test/kotlin/net/thauvin/erik/gradle/semver/SemverVersionSpec.kt index 1901673..dccb83c 100644 --- a/src/test/kotlin/net/thauvin/erik/gradle/semver/SemverVersionSpec.kt +++ b/src/test/kotlin/net/thauvin/erik/gradle/semver/SemverVersionSpec.kt @@ -37,9 +37,9 @@ import kotlin.test.assertEquals @Suppress("unused") object SemverVersionSpec : Spek({ - describe("a version") { + describe("test version") { val version = Version() - describe("valdiate default version") { + describe("validate default version") { it("major should be 1") { assertEquals("1", version.major) } @@ -68,7 +68,7 @@ object SemverVersionSpec : Spek({ assertEquals("1.0.0", version.semver) } } - describe("increment major") { + describe("increment") { it("should return 2.0.0") { version.increment(isMajor = true) assertEquals("2.0.0", version.semver)