forked from dokku-alt/dokku-alt
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_tests.sh
More file actions
executable file
·33 lines (27 loc) · 814 Bytes
/
Copy pathrun_tests.sh
File metadata and controls
executable file
·33 lines (27 loc) · 814 Bytes
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
#!/usr/bin/env bats
@test "filter pipelining" {
result=$(echo Hello world | $BIN text)
[[ $result == "DLROW OLLEH" ]]
}
@test "run all plugins with hook" {
result=$($BIN pre-build | wc -l)
[[ $result -eq 2 ]]
}
@test "run tests in series" {
times=( $($BIN time) )
[[ $(( ${times[0]} - ${times[1]} )) -ge 2 ]]
}
@test "run tests in parallel" {
times=( $($BIN -p time) )
[[ $(( ${times[0]} - ${times[1]} )) -le 1 ]]
}
@test "print trace of hook calls" {
stderr=$(echo Hello | $BIN -x cat 2>&1 >/dev/null)
[[ $stderr == +* ]]
stderr=$(echo Hello | $BIN -x -p cat 2>&1 >/dev/null)
[[ $stderr == +* ]]
stderr=$(echo Hello | PLUGINHOOK_TRACE=1 $BIN cat 2>&1 >/dev/null)
[[ $stderr == +* ]]
stderr=$(echo Hello | PLUGINHOOK_TRACE=1 $BIN -p cat 2>&1 >/dev/null)
[[ $stderr == +* ]]
}