summaryrefslogtreecommitdiff
path: root/test/segments/rust_version.spec
diff options
context:
space:
mode:
authorYang Tang <ytang@users.noreply.github.com>2018-10-12 18:29:50 +0300
committerGitHub <noreply@github.com>2018-10-12 18:29:50 +0300
commita98fa7ff54a0dc7b926deec99b69d5a0a0864a94 (patch)
treeb35d3df1b0ad12324f4094af98a576c6c933571e /test/segments/rust_version.spec
parent24bbbfc9bdbdc0666a53cd4a60a8b57551e9f0ca (diff)
parentb16c0d51d65249f0fdea86cd12cd64f6f0643b7e (diff)
Merge branch 'master' into fix-rprompt-icons-cut-off
Diffstat (limited to 'test/segments/rust_version.spec')
-rwxr-xr-xtest/segments/rust_version.spec21
1 files changed, 11 insertions, 10 deletions
diff --git a/test/segments/rust_version.spec b/test/segments/rust_version.spec
index 091d5217..7b6ffe7c 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{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{000}Rust %F{000}0.4.1a-alpha %k%F{208}%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{007} %F{000}world %k%F{007}%f " "$(build_left_prompt)"
}
-source shunit2/source/2.1/src/shunit2
+source shunit2/shunit2