summaryrefslogtreecommitdiff
path: root/test/segments/nodeenv.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/nodeenv.spec
parent4b32b2c0b246e65529e8e055c63be8d58be15f95 (diff)
Fix tests on older ZSH versions
Diffstat (limited to 'test/segments/nodeenv.spec')
-rwxr-xr-xtest/segments/nodeenv.spec15
1 files changed, 10 insertions, 5 deletions
diff --git a/test/segments/nodeenv.spec b/test/segments/nodeenv.spec
index bfa1d7fa..511a1a19 100755
--- a/test/segments/nodeenv.spec
+++ b/test/segments/nodeenv.spec
@@ -17,7 +17,8 @@ function setUp() {
}
function testNodeenvSegmentPrintsNothingWithoutNode() {
- local POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(nodeenv custom_world)
+ local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS
+ POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(nodeenv custom_world)
local POWERLEVEL9K_CUSTOM_WORLD='echo world'
alias node="nonode 2>/dev/null"
@@ -27,7 +28,8 @@ function testNodeenvSegmentPrintsNothingWithoutNode() {
}
function testNodeenvSegmentPrintsNothingIfNodeVirtualEnvIsNotSet() {
- local POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(nodeenv custom_world)
+ local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS
+ POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(nodeenv custom_world)
local POWERLEVEL9K_CUSTOM_WORLD='echo world'
node() {
echo "v1.2.3"
@@ -39,7 +41,8 @@ function testNodeenvSegmentPrintsNothingIfNodeVirtualEnvIsNotSet() {
}
function testNodeenvSegmentPrintsNothingIfNodeVirtualEnvDisablePromptIsSet() {
- local POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(nodeenv custom_world)
+ local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS
+ POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(nodeenv custom_world)
local POWERLEVEL9K_CUSTOM_WORLD='echo world'
node() {
echo "v1.2.3"
@@ -55,7 +58,8 @@ function testNodeenvSegmentPrintsNothingIfNodeVirtualEnvDisablePromptIsSet() {
}
function testNodeenvSegmentPrintsAtLeastNodeEnvWithoutNode() {
- local POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(nodeenv)
+ local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS
+ POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(nodeenv)
alias node="nonode 2>/dev/null"
NODE_VIRTUAL_ENV="node-env"
@@ -66,7 +70,8 @@ function testNodeenvSegmentPrintsAtLeastNodeEnvWithoutNode() {
}
function testNodeenvSegmentWorks() {
- local POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(nodeenv)
+ local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS
+ POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(nodeenv)
node() {
echo "v1.2.3"
}