-
-
Notifications
You must be signed in to change notification settings - Fork 56
Expand file tree
/
Copy pathtests.bats
More file actions
29 lines (20 loc) · 546 Bytes
/
Copy pathtests.bats
File metadata and controls
29 lines (20 loc) · 546 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
#!/usr/bin/env bats
source ./progress-bar.sh
SLEEP_DURATION=.01
export SLEEP_DURATION
@test "show nothings when no duration provided" {
run progress-bar
[[ $status == 0 ]]
[[ "${lines[0]}" == $(printf "\r") ]]
}
@test "show progress-bar when given duration" {
run progress-bar 1
[[ $status == 0 ]]
[[ "$output" == $(printf "▇| 100%%\r\r") ]]
}
@test "show multiple blocks on one line" {
run progress-bar 2
echo "$output" > /tmp/bats
[[ $status == 0 ]]
[[ "$output" == $(printf "▇ | 50%%\r▇▇| 100%%\r\r") ]]
}