-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.bats
executable file
·35 lines (33 loc) · 1.03 KB
/
test.bats
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/usr/bin/env bats
@test "Test valid cases" {
run ./entrypoint.sh "JI-0 My Awesome Title"
[ "$status" -eq 0 ]
run ./entrypoint.sh "JIRA-123 My Awesome Title"
[ "$status" -eq 0 ]
run ./entrypoint.sh "JIRAISSUE-1234567890 My Awesome Title"
[ "$status" -eq 0 ]
run ./entrypoint.sh "JIR-321 123 My Awesome Title"
[ "$status" -eq 0 ]
}
@test "Test invalid cases" {
run ./entrypoint.sh "J-0 My Awesome Title"
[ "$status" -eq 1 ]
run ./entrypoint.sh "JI-0 "
[ "$status" -eq 1 ]
run ./entrypoint.sh "JI-0 My Awesome Title"
[ "$status" -eq 1 ]
run ./entrypoint.sh "ji-0 My Awesome Title"
[ "$status" -eq 1 ]
run ./entrypoint.sh "jira-0 My Awesome Title"
[ "$status" -eq 1 ]
run ./entrypoint.sh "JIRA My Awesome Title"
[ "$status" -eq 1 ]
run ./entrypoint.sh "JIRA- My Awesome Title"
[ "$status" -eq 1 ]
run ./entrypoint.sh "JIRA0 My Awesome Title"
[ "$status" -eq 1 ]
run ./entrypoint.sh "JIRA-0: My Awesome Title"
[ "$status" -eq 1 ]
run ./entrypoint.sh " JIRA-123 My Awesome Title"
[ "$status" -eq 1 ]
}