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:
parent
3b0397d1a6
commit
518148383e
@ -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() {
|
||||
|
Loading…
Reference in New Issue
Block a user