1
0
mirror of https://github.com/romkatv/powerlevel10k.git synced 2024-12-12 19:18:28 +02:00

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.
This commit is contained in:
Dominik Ritter 2018-07-31 00:48:12 +02:00
parent 3b0397d1a6
commit 518148383e

View File

@ -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() {