diff options
Diffstat (limited to 'test/segments/context.spec')
-rwxr-xr-x | test/segments/context.spec | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/test/segments/context.spec b/test/segments/context.spec index e86bc357..702280df 100755 --- a/test/segments/context.spec +++ b/test/segments/context.spec @@ -23,41 +23,47 @@ function tearDown() { function testContextSegmentDoesNotGetRenderedWithDefaultUser() { local DEFAULT_USER=$(whoami) local POWERLEVEL9K_CUSTOM_WORLD='echo world' - local POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(context custom_world) + local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS + POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(context custom_world) assertEquals "%K{white} %F{black}world %k%F{white}%f " "$(build_left_prompt)" } function testContextSegmentDoesGetRenderedWhenSshConnectionIsOpen() { local SSH_CLIENT="putty" - local POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(context) + local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS + POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(context) assertEquals "%K{black} %F{yellow}%n@%m %k%F{black}%f " "$(build_left_prompt)" } function testContextSegmentWithForeignUser() { - local POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(context) + local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS + POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(context) assertEquals "%K{black} %F{yellow}%n@%m %k%F{black}%f " "$(build_left_prompt)" } # TODO: How to test root? function testContextSegmentWithRootUser() { - local POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(context) + local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS + POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(context) startSkipping # Skip test assertEquals "%K{black} %F{yellow}%n@%m %k%F{black}%f " "$(build_left_prompt)" } function testOverridingContextTemplate() { - local POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(context) + local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS + POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(context) local POWERLEVEL9K_CONTEXT_TEMPLATE=xx assertEquals "%K{black} %F{yellow}xx %k%F{black}%f " "$(build_left_prompt)" } function testContextSegmentIsShownIfDefaultUserIsSetWhenForced() { - local POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(context) + local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS + POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(context) local POWERLEVEL9K_ALWAYS_SHOW_CONTEXT=true local DEFAULT_USER=$(whoami) @@ -65,7 +71,8 @@ function testContextSegmentIsShownIfDefaultUserIsSetWhenForced() { } function testContextSegmentIsShownIfForced() { - local POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(context) + local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS + POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(context) local POWERLEVEL9K_ALWAYS_SHOW_USER=true local DEFAULT_USER=$(whoami) |