Skip to content

Commit 0641363

Browse files
committed
[Tests] install.sh: clean up nvm_detect_profile tests
1 parent 9659af6 commit 0641363

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

test/install_script/nvm_detect_profile

+10-10
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ if [ "$NVM_DETECT_PROFILE" != "$HOME/.zshrc" ]; then
6565
fi
6666

6767
# $PROFILE should override .zshrc profile detection
68-
NVM_DETECT_PROFILE="$(SHELL="/usr/bin/zsh"; PROFILE="test_profile"; nvm_detect_profile)"
68+
NVM_DETECT_PROFILE="$(SHELL="/usr/bin/zsh" PROFILE="test_profile" nvm_detect_profile)"
6969
if [ "$NVM_DETECT_PROFILE" != "test_profile" ]; then
7070
die "nvm_detect_profile ignored \$PROFILE"
7171
fi
@@ -82,7 +82,7 @@ fi
8282

8383
# $PROFILE is not a valid file
8484
rm "test_profile"
85-
NVM_DETECT_PROFILE="$(PROFILE="test_profile"; nvm_detect_profile)"
85+
NVM_DETECT_PROFILE="$(PROFILE="test_profile" nvm_detect_profile)"
8686
if [ "$NVM_DETECT_PROFILE" = "test_profile" ]; then
8787
die "nvm_detect_profile picked \$PROFILE when it was an invalid file"
8888
fi
@@ -96,56 +96,56 @@ fi
9696
# It should favor .profile if file exists
9797
NVM_DETECT_PROFILE="$(SHELL= ZDOTDIR= nvm_detect_profile)"
9898
if [ "$NVM_DETECT_PROFILE" != "$HOME/.profile" ]; then
99-
die "nvm_detect_profile should have selected .profile"
99+
die "nvm_detect_profile should have selected .profile; got $NVM_DETECT_PROFILE"
100100
fi
101101

102102
# Otherwise, it should favor .bashrc if file exists
103103
rm ".profile"
104104
NVM_DETECT_PROFILE="$(SHELL= ZDOTDIR= nvm_detect_profile)"
105105
if [ "$NVM_DETECT_PROFILE" != "$HOME/.bashrc" ]; then
106-
die "nvm_detect_profile should have selected .bashrc"
106+
die "nvm_detect_profile should have selected .bashrc; got $NVM_DETECT_PROFILE"
107107
fi
108108

109109
# Otherwise, it should favor .bash_profile if file exists
110110
rm ".bashrc"
111111
NVM_DETECT_PROFILE="$(SHELL= ZDOTDIR= nvm_detect_profile)"
112112
if [ "$NVM_DETECT_PROFILE" != "$HOME/.bash_profile" ]; then
113-
die "nvm_detect_profile should have selected .bash_profile"
113+
die "nvm_detect_profile should have selected .bash_profile; got $NVM_DETECT_PROFILE"
114114
fi
115115

116116
# Otherwise, it should favor zdotdir/.zprofile if file exists
117117
rm ".bash_profile"
118118
NVM_DETECT_PROFILE="$(SHELL= nvm_detect_profile)"
119119
if [ "$NVM_DETECT_PROFILE" != "$ZDOTDIR/.zprofile" ]; then
120-
die "nvm_detect_profile should have selected zdotdir/.zprofile"
120+
die "nvm_detect_profile should have selected zdotdir/.zprofile; got $NVM_DETECT_PROFILE"
121121
fi
122122

123123
# Otherwise, it should favor .zprofile if file exists
124124
rm "zdotdir/.zprofile"
125125
NVM_DETECT_PROFILE="$(SHELL= ZDOTDIR= nvm_detect_profile)"
126126
if [ "$NVM_DETECT_PROFILE" != "$HOME/.zprofile" ]; then
127-
die "nvm_detect_profile should have selected .zprofile"
127+
die "nvm_detect_profile should have selected .zprofile; got $NVM_DETECT_PROFILE"
128128
fi
129129

130130
# Otherwise, it should favor zdotdir/.zshrc if file exists
131131
rm ".zprofile"
132132
NVM_DETECT_PROFILE="$(SHELL= nvm_detect_profile)"
133133
if [ "$NVM_DETECT_PROFILE" != "$ZDOTDIR/.zshrc" ]; then
134-
die "nvm_detect_profile should have selected zdotdir/.zshrc"
134+
die "nvm_detect_profile should have selected zdotdir/.zshrc; got $NVM_DETECT_PROFILE"
135135
fi
136136

137137
# Otherwise, it should favor .zshrc if file exists
138138
rm "zdotdir/.zshrc"
139139
NVM_DETECT_PROFILE="$(SHELL= ZDOTDIR= nvm_detect_profile)"
140140
if [ "$NVM_DETECT_PROFILE" != "$HOME/.zshrc" ]; then
141-
die "nvm_detect_profile should have selected .zshrc"
141+
die "nvm_detect_profile should have selected .zshrc; got $NVM_DETECT_PROFILE"
142142
fi
143143

144144
# It should be empty if none is found
145145
rm ".zshrc"
146146
NVM_DETECT_PROFILE="$(SHELL= nvm_detect_profile)"
147147
if [ ! -z "$NVM_DETECT_PROFILE" ]; then
148-
die "nvm_detect_profile should have returned an empty value"
148+
die "nvm_detect_profile should have returned an empty value; got $NVM_DETECT_PROFILE"
149149
fi
150150

151151
cleanup

0 commit comments

Comments
 (0)