-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathutils.bats
More file actions
executable file
Β·49 lines (38 loc) Β· 784 Bytes
/
Copy pathutils.bats
File metadata and controls
executable file
Β·49 lines (38 loc) Β· 784 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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/usr/bin/env bats
# Common utility tests
@test "bash version 3.0 or higher" {
# macOS ships with bash 3.2, Linux typically has 4.0+
# Most scripts work with bash 3.2+
[[ "${BASH_VERSION%%.*}" -ge 3 ]]
}
@test "grep available" {
command -v grep
}
@test "awk available" {
command -v awk
}
@test "sed available" {
command -v sed
}
@test "curl or wget available" {
command -v curl || command -v wget
}
@test "date command works" {
run date
[ "$status" -eq 0 ]
}
@test "hostname command works" {
run hostname
[ "$status" -eq 0 ]
}
@test "whoami command works" {
run whoami
[ "$status" -eq 0 ]
}
@test "environment variables set" {
[ -n "$HOME" ]
[ -n "$PATH" ]
}
@test "tmp directory writable" {
[ -w "/tmp" ]
}