summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDominik Ritter <dritter03@googlemail.com>2018-07-31 01:48:12 +0300
committerDominik Ritter <dritter03@googlemail.com>2018-07-31 02:02:24 +0300
commit518148383ecebe2536bf9db7c316c4e646cb5f8a (patch)
tree11a149adfbd482a6ef5b11c993117f7dd4a38a0e /test
parent3b0397d1a6ce72516bb484197eceaf4498c1c2ab (diff)
Fix Test for context segment
This fixes an error on travis, because there is no sudo allowed. We could allow it, but I think it is better to mock sudo anyway.
Diffstat (limited to 'test')
-rwxr-xr-xtest/segments/context.spec5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/segments/context.spec b/test/segments/context.spec
index b350caf7..2cef90dd 100755
--- a/test/segments/context.spec
+++ b/test/segments/context.spec
@@ -31,6 +31,9 @@ function testContextSegmentDoesNotGetRenderedWithDefaultUser() {
}
function testContextSegmentDoesGetRenderedWhenSshConnectionIsOpen() {
+ function sudo() {
+ return 0
+ }
local SSH_CLIENT="putty"
local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS
POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(context)
@@ -39,6 +42,8 @@ function testContextSegmentDoesGetRenderedWhenSshConnectionIsOpen() {
source powerlevel9k.zsh-theme
assertEquals "%K{black} %F{yellow}%n@%m %k%F{black}%f " "$(build_left_prompt)"
+
+ unfunction sudo
}
function testContextSegmentWithForeignUser() {