-
-
Notifications
You must be signed in to change notification settings - Fork 213
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #816 from robstoll/change-deprecation-to-0.17.0
Change deprecation removal to 0.17.0
- Loading branch information
Showing
19 changed files
with
184 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,6 @@ coverage: | |
|
||
codecov: | ||
notify: | ||
after_n_builds: 4 | ||
after_n_builds: 5 | ||
comment: | ||
after_n_builds: 4 | ||
after_n_builds: 5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
core/api/atrium-core-api-common/src/test/kotlin/ch/tutteli/atrium/reporting/TextSpec.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package ch.tutteli.atrium.reporting | ||
|
||
import ch.tutteli.atrium.api.infix.en_GB.* | ||
import ch.tutteli.atrium.api.verbs.internal.expect | ||
import ch.tutteli.atrium.reporting.erroradjusters.NoOpAtriumErrorAdjuster | ||
import org.spekframework.spek2.Spek | ||
import org.spekframework.spek2.style.specification.describe | ||
|
||
class TextSpec : Spek({ | ||
describe("creating a Text") { | ||
it("empty string; throws IllegalArgumentException") { | ||
expect{ | ||
Text("") | ||
}.toThrow<IllegalArgumentException> { | ||
messageContains("use Text.Empty instead") | ||
} | ||
} | ||
|
||
it("blank string; does not throw") { | ||
Text(" ") | ||
} | ||
} | ||
}) |
96 changes: 96 additions & 0 deletions
96
...ommon/src/test/kotlin/ch/tutteli/atrium/reporting/translating/TranslatableWithArgsSpec.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
package ch.tutteli.atrium.reporting.translating | ||
|
||
import ch.tutteli.atrium.api.infix.en_GB.* | ||
import ch.tutteli.atrium.api.verbs.internal.expect | ||
import ch.tutteli.atrium.reporting.Text | ||
import ch.tutteli.atrium.reporting.erroradjusters.NoOpAtriumErrorAdjuster | ||
import ch.tutteli.atrium.reporting.translating.Translations.* | ||
import org.spekframework.spek2.Spek | ||
import org.spekframework.spek2.style.specification.describe | ||
|
||
class TranslatableWithArgsSpec : Spek({ | ||
describe("creating a TranslatableWithArgs") { | ||
context("for a translatable without args") { | ||
it("no arguments given; throws") { | ||
expect { | ||
TranslatableWithArgs(HELLO, listOf()) | ||
}.toThrow<IllegalArgumentException> { | ||
its messageContains values( | ||
"No arguments specified" | ||
) | ||
} | ||
} | ||
it("one argument given; throws") { | ||
expect { | ||
TranslatableWithArgs(HELLO, "one") | ||
}.toThrow<IllegalArgumentException> { | ||
its messageContains values( | ||
"The number of given arguments does not match the number of placeholders in", | ||
"number of arguments = 1", | ||
"placeholders = 0" | ||
) | ||
} | ||
} | ||
} | ||
context("for a translatable with 1 arg") { | ||
it("no arguments given; throws") { | ||
expect { | ||
TranslatableWithArgs(WITH_1_ARG, listOf()) | ||
}.toThrow<IllegalArgumentException> { | ||
its messageContains values( | ||
"No arguments specified" | ||
) | ||
} | ||
} | ||
it("one argument given; OK") { | ||
expect(TranslatableWithArgs(WITH_1_ARG, "hello").getDefault()).toBe("a) hello") | ||
expect(TranslatableWithArgs(WITH_1_ARG, listOf("hello")).getDefault()).toBe("a) hello") | ||
} | ||
it("two arguments given; throws") { | ||
expect { | ||
TranslatableWithArgs(WITH_1_ARG, "one", "two") | ||
}.toThrow<IllegalArgumentException> { | ||
its messageContains values( | ||
"The number of given arguments does not match the number of placeholders in", | ||
"number of arguments = 2", | ||
"placeholders = 1" | ||
) | ||
} | ||
} | ||
} | ||
context("for a translatable with 2 args") { | ||
it("no arguments given; throws") { | ||
expect { | ||
TranslatableWithArgs(WITH_2_ARGS, listOf()) | ||
}.toThrow<IllegalArgumentException> { | ||
its messageContains values( | ||
"No arguments specified" | ||
) | ||
} | ||
} | ||
it("one argument given; throws") { | ||
expect { | ||
TranslatableWithArgs(WITH_2_ARGS, "one") | ||
}.toThrow<IllegalArgumentException> { | ||
its messageContains values( | ||
"The number of given arguments does not match the number of placeholders in", | ||
"number of arguments = 1", | ||
"placeholders = 2" | ||
) | ||
} | ||
} | ||
it("two arguments given; OK") { | ||
expect(TranslatableWithArgs(WITH_2_ARGS, "hello", "world").getDefault()).toBe("a) hello b) world") | ||
expect(TranslatableWithArgs(WITH_2_ARGS, listOf("hello", "world")).getDefault()) | ||
.toBe("a) hello b) world") | ||
} | ||
} | ||
} | ||
}) | ||
|
||
private enum class Translations(override val value: String) : StringBasedTranslatable { | ||
HELLO("hello"), | ||
WITH_1_ARG("a) %s"), | ||
WITH_2_ARGS("a) %s b) %s"), | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters