From b08f576aaaac1242a35a8b9d6dd7482a8124d732 Mon Sep 17 00:00:00 2001 From: nea Date: Fri, 13 Aug 2021 01:30:12 +0200 Subject: use a javascript viable tester --- src/jsTest/kotlin/io/PathTest.kt | 47 ++++++++++++++++++++-------------------- 1 file changed, 23 insertions(+), 24 deletions(-) (limited to 'src/jsTest/kotlin/io') diff --git a/src/jsTest/kotlin/io/PathTest.kt b/src/jsTest/kotlin/io/PathTest.kt index 2649a2a..73667a6 100644 --- a/src/jsTest/kotlin/io/PathTest.kt +++ b/src/jsTest/kotlin/io/PathTest.kt @@ -1,32 +1,31 @@ package io -import io.kotest.core.spec.style.DescribeSpec +import io.kotest.core.spec.style.FunSpec +import io.kotest.matchers.booleans.shouldBeFalse import io.kotest.matchers.types.shouldBeTypeOf -class PathTest : DescribeSpec({ - describe("Path") { - val homeDir = Path.of("/home") as Path.Absolute - it("recognize relative paths as such") { - listOf( - Path.of("a/b"), - Path.of("."), - Path.of("a", "b"), - Path.ofShell("a/b", userHome = homeDir), - Path.ofShell(".", userHome = homeDir), - Path.ofShell("a", "b", userHome = homeDir), - Path.ofShell(listOf("a", "b"), userHome = homeDir), - ).forEach { - it.shouldBeTypeOf() - } +class PathTest : FunSpec({ + val homeDir = Path.of("/home") as Path.Absolute + test("recognize relative paths as such") { + listOf( + Path.of("a/b"), + Path.of("."), + Path.of("a", "b"), + Path.ofShell("a/b", userHome = homeDir), + Path.ofShell(".", userHome = homeDir), + Path.ofShell("a", "b", userHome = homeDir), + Path.ofShell(listOf("a", "b"), userHome = homeDir), + ).forEach { + it.shouldBeTypeOf() } - it("recognize absolute paths as such") { - listOf( - Path.of("/a/b"), - Path.of("/"), - Path.ofShell("/b/c", userHome = homeDir), - ).forEach { - it.shouldBeTypeOf() - } + } + test("recognize absolute paths as such") { + listOf( + Path.of("/a/b"), + Path.of("/"), + Path.ofShell("/b/c", userHome = homeDir), + ).forEach { + it.shouldBeTypeOf() } } }) -- cgit