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