File tree Expand file tree Collapse file tree 3 files changed +16
-10
lines changed Expand file tree Collapse file tree 3 files changed +16
-10
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,6 @@ echo_bpm_variables_posix() {
6
6
export BPM_ROOT="$BPM_ROOT "
7
7
export BPM_REPO_ROOT="$BPM_ROOT /source"
8
8
export BPM_PREFIX="$BPM_PREFIX "
9
- export BPM_PACKAGES_PATH="$BPM_PACKAGES_PATH "
10
9
11
10
EOF
12
11
}
@@ -56,7 +55,6 @@ do-init() {
56
55
set -gx BPM_ROOT $BPM_ROOT
57
56
set -gx BPM_REPO_ROOT $BPM_ROOT /source
58
57
set -gx BPM_PREFIX $BPM_PREFIX
59
- set -gx BPM_PACKAGES_PATH $BPM_PACKAGES_PATH
60
58
61
59
# bpm completion
62
60
source \$ BPM_REPO_ROOT/completions/bpm.fish
Original file line number Diff line number Diff line change 3
3
load ' ./util/init.sh'
4
4
5
5
@test " exports BPM_ROOT" {
6
- BPM_ROOT=/lol run do-init bash
6
+ unset BPM_ROOT
7
+ eval " $( BPM_ROOT=/lol do-init bash) "
7
8
8
9
assert_success
9
- assert_line -p ' export BPM_ROOT="/lol"'
10
+ assert [ " $BPM_ROOT " = ' /lol' ]
11
+ assert test_util.is_exported ' BPM_ROOT'
10
12
}
11
13
14
+
12
15
@test " exports BPM_PREFIX" {
13
16
BPM_PREFIX=/lol run do-init bash
14
17
15
18
assert_success
16
19
assert_line -p ' export BPM_PREFIX="/lol"'
17
20
}
18
21
19
- @test " exports BPM_PACKAGES_PATH" {
20
- BPM_PACKAGES_PATH=/lol run do-init bash
21
-
22
- assert_success
23
- assert_line -p ' export BPM_PACKAGES_PATH="/lol"'
24
- }
25
22
26
23
@test " errors if shell is not available" {
27
24
run do-init fakesh
Original file line number Diff line number Diff line change 1
1
# shellcheck shell=bash
2
2
# shellcheck disable=SC2164
3
3
4
+ test_util.is_exported () {
5
+ local variable_name=" $1 "
6
+
7
+ local -n variable=" $variable_name "
8
+ if [[ " ${variable@ a} " == * x* ]]; then
9
+ return 0
10
+ else
11
+ return 1
12
+ fi
13
+ }
14
+
4
15
test_util.get_repo_root () {
5
16
REPLY=
6
17
if ! REPLY=" $(
You can’t perform that action at this time.
0 commit comments