-
Notifications
You must be signed in to change notification settings - Fork 5
/
gambit_io.bats
66 lines (53 loc) · 1.36 KB
/
gambit_io.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#!/usr/bin/env bats
#
# GAMBIT basic i/o tests in BATS framework. See e.g. https://github.com/sstephenson/bats
#
# Written by A. Fowlie.
# GAMBIT helper functions.
load funcs
load gambit
setup() {
:
}
# Echo information on teardown, if error
teardown() {
error "$output"
rm -rf ./runs # This shouldn't be neccessary
rm -rf $GAMBIT/runs # This shouldn't be neccessary
}
# BAT framework tests - make information as descriptive as possible.
@test "relative yaml imports gambit" {
run $GAMBIT/gambit -f ./yaml/import.yaml
[ $status = 0 ]
}
@test "nonexistent yaml using gambit" {
run "$GAMBIT"/gambit -f no.yaml
[ $status -ne 0 ]
}
@test "no yaml using gambit" {
skip "We should fix this return code but skip for now"
run "$GAMBIT"/gambit -f
[ $status -ne 0 ]
}
@test "empty yaml using gambit" {
run "$GAMBIT"/gambit -f ./yaml/empty.yaml
[ $status -ne 0 ]
}
@test "unknown option using gambit" {
skip "We should fix this return code but skip for now"
run "$GAMBIT"/gambit --unknown
[ $status -ne 0 ]
}
@test "no options using gambit" {
run $GAMBIT/gambit
[ $status = 0 ]
}
@test "runs folder from empty yaml" {
run "$GAMBIT"/gambit -f ./yaml/empty.yaml
[ ! -e $GAMBIT/runs ]
}
@test "local runs folder from empty yaml" {
skip "We shouldn't make this directory but skip for now"
run "$GAMBIT"/gambit -f ./yaml/empty.yaml
[ ! -e ./runs ]
}