diff options
Diffstat (limited to 'test/segments/rust_version.spec')
-rwxr-xr-x | test/segments/rust_version.spec | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/test/segments/rust_version.spec b/test/segments/rust_version.spec index 34883a10..9643125f 100755 --- a/test/segments/rust_version.spec +++ b/test/segments/rust_version.spec @@ -14,8 +14,6 @@ function setUp() { PATH="${RUST_TEST_FOLDER}:${PATH}" export TERM="xterm-256color" - # Load Powerlevel9k - source powerlevel9k.zsh-theme } function tearDown() { @@ -29,22 +27,25 @@ function mockRust() { } function testRust() { - mockRust + local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(rust_version) + mockRust - assertEquals "%K{208} %F{black%}Rust %f%F{black}0.4.1a-alpha %k%F{darkorange}%f " "$(build_left_prompt)" + # Load Powerlevel9k + source powerlevel9k.zsh-theme - unset POWERLEVEL9K_LEFT_PROMPT_ELEMENTS + assertEquals "%K{208} %F{black%}Rust %f%F{black}0.4.1a-alpha %k%F{darkorange}%f " "$(build_left_prompt)" } function testRustPrintsNothingIfRustIsNotAvailable() { - POWERLEVEL9K_CUSTOM_WORLD='echo world' + local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(custom_world rust_version) + local POWERLEVEL9K_CUSTOM_WORLD='echo world' - assertEquals "%K{white} %F{black}world %k%F{white}%f " "$(build_left_prompt)" + # Load Powerlevel9k + source powerlevel9k.zsh-theme - unset POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - unset POWERLEVEL9K_CUSTOM_WORLD + assertEquals "%K{white} %F{black}world %k%F{white}%f " "$(build_left_prompt)" } -source shunit2/source/2.1/src/shunit2 +source shunit2/shunit2 |