-
-
Notifications
You must be signed in to change notification settings - Fork 28
Expand file tree
/
Copy pathis_readable.bats
More file actions
34 lines (29 loc) · 668 Bytes
/
Copy pathis_readable.bats
File metadata and controls
34 lines (29 loc) · 668 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
#!/usr/bin/env bats
setup_fixture
@test "l.is_readable a normal file" {
local temp="$BATS_TEST_TMPDIR/normal"
: > "$temp"
run l.is_readable "$temp"
assert_success
assert_output ''
}
@test "l.is_readable a executable file" {
local temp="$BATS_TEST_TMPDIR/executable"
: > "$temp"
chmod +x "$temp"
run l.is_readable "$temp"
assert_success
assert_output ''
}
@test "l.is_readable a directory" {
local temp=$BATS_TEST_TMPDIR
run l.is_readable "$temp"
assert_success
# interesting https://superuser.com/a/168583
assert_output ''
}
@test "l.is_readable unexist path" {
run l.is_readable /not-exist
assert_failure
assert_output ''
}