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.
pull/22/head
Dominik Ritter 6 years ago
parent 3b0397d1a6
commit 518148383e

@ -31,6 +31,9 @@ function testContextSegmentDoesNotGetRenderedWithDefaultUser() {
} }
function testContextSegmentDoesGetRenderedWhenSshConnectionIsOpen() { function testContextSegmentDoesGetRenderedWhenSshConnectionIsOpen() {
function sudo() {
return 0
}
local SSH_CLIENT="putty" local SSH_CLIENT="putty"
local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS
POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(context) POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(context)
@ -39,6 +42,8 @@ function testContextSegmentDoesGetRenderedWhenSshConnectionIsOpen() {
source powerlevel9k.zsh-theme source powerlevel9k.zsh-theme
assertEquals "%K{black} %F{yellow}%n@%m %k%F{black}%f " "$(build_left_prompt)" assertEquals "%K{black} %F{yellow}%n@%m %k%F{black}%f " "$(build_left_prompt)"
unfunction sudo
} }
function testContextSegmentWithForeignUser() { function testContextSegmentWithForeignUser() {

Loading…
Cancel
Save