mirror of
https://github.com/romkatv/powerlevel10k.git
synced 2024-12-22 15:21:56 +00: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
1 changed files with 5 additions and 0 deletions
|
@ -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…
Reference in a new issue