summaryrefslogtreecommitdiff
path: root/test/segments/nvm.spec
diff options
context:
space:
mode:
authorDominik Ritter <dritter03@googlemail.com>2018-07-19 23:39:19 +0300
committerDominik Ritter <dritter03@googlemail.com>2018-07-19 23:39:19 +0300
commit16e5e14af747bb310dabd367648b5566cd2edc6b (patch)
tree9593ab0319da9f99bbc5dd29d437b092a806bfb7 /test/segments/nvm.spec
parent4b32b2c0b246e65529e8e055c63be8d58be15f95 (diff)
Fix tests on older ZSH versions
Diffstat (limited to 'test/segments/nvm.spec')
-rwxr-xr-xtest/segments/nvm.spec9
1 files changed, 6 insertions, 3 deletions
diff --git a/test/segments/nvm.spec b/test/segments/nvm.spec
index 8f3b3c26..f4a4812a 100755
--- a/test/segments/nvm.spec
+++ b/test/segments/nvm.spec
@@ -32,14 +32,16 @@ function tearDown() {
}
function testNvmSegmentPrintsNothingIfNvmIsNotAvailable() {
- local POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(nvm custom_world)
+ local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS
+ POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(nvm custom_world)
local POWERLEVEL9K_CUSTOM_WORLD='echo world'
assertEquals "%K{white} %F{black}world %k%F{white}%f " "$(build_left_prompt)"
}
function testNvmSegmentWorksWithoutHavingADefaultAlias() {
- local POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(nvm)
+ local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS
+ POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(nvm)
function nvm_version() {
[[ ${1} == 'current' ]] && echo 'v4.6.0' || echo 'v1.4.0'
@@ -49,7 +51,8 @@ function testNvmSegmentWorksWithoutHavingADefaultAlias() {
}
function testNvmSegmentPrintsNothingWhenOnDefaultVersion() {
- local POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(nvm custom_world)
+ local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS
+ POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(nvm custom_world)
local POWERLEVEL9K_CUSTOM_WORLD='echo world'
function nvm_version() {