diff options
author | Dominik Ritter <dritter03@googlemail.com> | 2018-07-31 01:48:12 +0300 |
---|---|---|
committer | Dominik Ritter <dritter03@googlemail.com> | 2018-07-31 02:02:24 +0300 |
commit | 518148383ecebe2536bf9db7c316c4e646cb5f8a (patch) | |
tree | 11a149adfbd482a6ef5b11c993117f7dd4a38a0e /test/segments/context.spec | |
parent | 3b0397d1a6ce72516bb484197eceaf4498c1c2ab (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/segments/context.spec')
-rwxr-xr-x | test/segments/context.spec | 5 |
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() { |