aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDominik Ritter <dritter03@googlemail.com>2018-10-13 11:24:24 +0300
committerGitHub <noreply@github.com>2018-10-13 11:24:24 +0300
commitad14807cef372994c3ba00632117f6d43b798ffb (patch)
tree89d0b3dd7099fb110f6d77f64f7824131ff39935
parentb16c0d51d65249f0fdea86cd12cd64f6f0643b7e (diff)
parentd831f12126374b0d1ba2207e24fa9749e795779f (diff)
Merge pull request #1020 from dritter/fix_context_spec
Fix context spec
-rwxr-xr-xtest/segments/context.spec18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/segments/context.spec b/test/segments/context.spec
index 07300370..25c355a7 100755
--- a/test/segments/context.spec
+++ b/test/segments/context.spec
@@ -11,11 +11,29 @@ function setUp() {
# Test specific settings
OLD_DEFAULT_USER=$DEFAULT_USER
unset DEFAULT_USER
+
+ # Fix leaked state for travis
+ OLD_POWERLEVEL9K_CONTEXT_ALWAYS_SHOW=$POWERLEVEL9K_CONTEXT_ALWAYS_SHOW
+ unset POWERLEVEL9K_CONTEXT_ALWAYS_SHOW
+ OLD_SSH_CLIENT=$SSH_CLIENT
+ unset SSH_CLIENT
+ OLD_SSH_TTY=$SSH_TTY
+ unset SSH_TTY
}
function tearDown() {
# Restore old variables
[[ -n "$OLD_DEFAULT_USER" ]] && DEFAULT_USER=$OLD_DEFAULT_USER
+ unset OLD_DEFAULT_USER
+
+ [[ -n "$OLD_POWERLEVEL9K_CONTEXT_ALWAYS_SHOW" ]] && POWERLEVEL9K_CONTEXT_ALWAYS_SHOW=$OLD_POWERLEVEL9K_CONTEXT_ALWAYS_SHOW
+ unset OLD_POWERLEVEL9K_CONTEXT_ALWAYS_SHOW
+
+ [[ -n "$OLD_SSH_CLIENT" ]] && SSH_CLIENT=$OLD_SSH_CLIENT
+ unset OLD_SSH_CLIENT
+
+ [[ -n "$OLD_SSH_TTY" ]] && SSH_TTY=$OLD_SSH_TTY
+ unset OLD_SSH_TTY
return 0
}