Skip to content
This repository has been archived by the owner on Apr 24, 2020. It is now read-only.

Commit

Permalink
Fix Test for context segment
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
dritter committed Jul 30, 2018
1 parent 3b0397d commit 5181483
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test/segments/context.spec
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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() {
Expand Down

0 comments on commit 5181483

Please sign in to comment.