aboutsummaryrefslogtreecommitdiff
path: root/test/segments/rust_version.spec
diff options
context:
space:
mode:
authorDominik Ritter <dritter03@googlemail.com>2018-07-24 17:24:33 +0300
committerDominik Ritter <dritter03@googlemail.com>2018-07-24 17:24:33 +0300
commit4972f0b8eba711f0dafc46cdbb4e191d550da091 (patch)
treecac634f7706fc43973785ca467c2285423608d39 /test/segments/rust_version.spec
parent822b820a6e0d7cec4ec60de23faecec6b77712b6 (diff)
Improve tests by making use of local variables
Diffstat (limited to 'test/segments/rust_version.spec')
-rwxr-xr-xtest/segments/rust_version.spec11
1 files changed, 4 insertions, 7 deletions
diff --git a/test/segments/rust_version.spec b/test/segments/rust_version.spec
index 34883a10..3d627498 100755
--- a/test/segments/rust_version.spec
+++ b/test/segments/rust_version.spec
@@ -29,22 +29,19 @@ 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)"
-
- unset POWERLEVEL9K_LEFT_PROMPT_ELEMENTS
}
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)"
-
- unset POWERLEVEL9K_LEFT_PROMPT_ELEMENTS
- unset POWERLEVEL9K_CUSTOM_WORLD
}
source shunit2/source/2.1/src/shunit2