Skip to content

Commit cccc1c1

Browse files
committed
Address feedback
1 parent 3588cae commit cccc1c1

File tree

1 file changed

+57
-55
lines changed
  • jit-binding-server/src/test/kotlin/io/github/typesafegithub/workflows/jitbindingserver

1 file changed

+57
-55
lines changed

jit-binding-server/src/test/kotlin/io/github/typesafegithub/workflows/jitbindingserver/ActionCoordsTest.kt

Lines changed: 57 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -12,70 +12,72 @@ import io.ktor.http.ParametersBuilder
1212
class ActionCoordsTest :
1313
FunSpec(
1414
{
15-
test("extractActionCoords parses owner/name with version and no path, FULL by default") {
16-
val parameters = createParameters(owner = "o", name = "act", version = "v1")
15+
context("extractActionCoords") {
16+
test("parses owner/name with version and no path, FULL by default") {
17+
val parameters = createParameters(owner = "o", name = "act", version = "v1")
1718

18-
parameters.extractActionCoords(true) shouldBe
19-
ActionCoords(
20-
owner = "o",
21-
name = "act",
22-
version = "v1",
23-
significantVersion = FULL,
24-
path = null,
25-
)
26-
}
19+
parameters.extractActionCoords(extractVersion = true) shouldBe
20+
ActionCoords(
21+
owner = "o",
22+
name = "act",
23+
version = "v1",
24+
significantVersion = FULL,
25+
path = null,
26+
)
27+
}
2728

28-
test("extractActionCoords parses owner/name with path and significant version suffix") {
29-
val parameters = createParameters(owner = "o", name = "act__p1__p2___major", version = "v9")
29+
test("parses owner/name with path and significant version suffix") {
30+
val parameters = createParameters(owner = "o", name = "act__p1__p2___major", version = "v9")
3031

31-
parameters.extractActionCoords(true) shouldBe
32-
ActionCoords(
33-
owner = "o",
34-
name = "act",
35-
version = "v9",
36-
significantVersion = MAJOR,
37-
path = "p1/p2",
38-
)
39-
}
32+
parameters.extractActionCoords(extractVersion = true) shouldBe
33+
ActionCoords(
34+
owner = "o",
35+
name = "act",
36+
version = "v9",
37+
significantVersion = MAJOR,
38+
path = "p1/p2",
39+
)
40+
}
4041

41-
test("when extractVersion=false, version field is set to 'irrelevant'") {
42-
val parameters = createParameters(owner = "o", name = "act___minor")
42+
test("when extractVersion=false, version field is set to 'irrelevant'") {
43+
val parameters = createParameters(owner = "o", name = "act___minor")
4344

44-
parameters.extractActionCoords(false) shouldBe
45-
ActionCoords(
46-
owner = "o",
47-
name = "act",
48-
version = "irrelevant",
49-
significantVersion = MINOR,
50-
path = null,
51-
)
52-
}
45+
parameters.extractActionCoords(extractVersion = false) shouldBe
46+
ActionCoords(
47+
owner = "o",
48+
name = "act",
49+
version = "irrelevant",
50+
significantVersion = MINOR,
51+
path = null,
52+
)
53+
}
5354

54-
test("unknown significant version part falls back to FULL") {
55-
val parameters = createParameters(owner = "o", name = "act___weird")
55+
test("unknown significant version part falls back to FULL") {
56+
val parameters = createParameters(owner = "o", name = "act___weird")
5657

57-
parameters.extractActionCoords(false) shouldBe
58-
ActionCoords(
59-
owner = "o",
60-
name = "act",
61-
version = "irrelevant",
62-
significantVersion = FULL,
63-
path = null,
64-
)
65-
}
58+
parameters.extractActionCoords(extractVersion = false) shouldBe
59+
ActionCoords(
60+
owner = "o",
61+
name = "act",
62+
version = "irrelevant",
63+
significantVersion = FULL,
64+
path = null,
65+
)
66+
}
6667

67-
test("handles name with underscores/hyphens and path segments") {
68-
val parameters =
69-
createParameters(owner = "o", name = "my_action-name__dir_one__dir-two___minor", version = "v2")
68+
test("handles name with underscores/hyphens and path segments") {
69+
val parameters =
70+
createParameters(owner = "o", name = "my_action-name__dir_one__dir-two___minor", version = "v2")
7071

71-
parameters.extractActionCoords(true) shouldBe
72-
ActionCoords(
73-
owner = "o",
74-
name = "my_action-name",
75-
version = "v2",
76-
significantVersion = MINOR,
77-
path = "dir_one/dir-two",
78-
)
72+
parameters.extractActionCoords(extractVersion = true) shouldBe
73+
ActionCoords(
74+
owner = "o",
75+
name = "my_action-name",
76+
version = "v2",
77+
significantVersion = MINOR,
78+
path = "dir_one/dir-two",
79+
)
80+
}
7981
}
8082
},
8183
)

0 commit comments

Comments
 (0)