forked from adoyle-h/lobash
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathis_exported.bats
47 lines (40 loc) · 853 Bytes
/
is_exported.bats
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
#!/usr/bin/env bats
setup_fixture
test_prepare is_exported
load_module is_exported
@test "l.is_exported <exported variable> -> true" {
export a=1
run l.is_exported a
assert_success
assert_output ''
}
@test "l.is_exported <unexported variable>-> false" {
b=1
run l.is_exported b
assert_failure
assert_output ''
}
@test "l.is_exported <undefined variable> -> false" {
run l.is_exported c
assert_failure
assert_output ''
}
@test "l.is_exported <readonly variable> -> false" {
d=1
readonly
run l.is_exported d
assert_failure
assert_output ''
}
@test "l.is_exported <array variable> -> false" {
declare -a e=(1)
run l.is_exported e
assert_failure
assert_output ''
}
@test "l.is_exported <associate array variable> -> false" {
declare -A f=([foo]=1)
run l.is_exported f
assert_failure
assert_output ''
}