diff options
author | Dominik Ritter <dritter03@googlemail.com> | 2018-07-24 17:24:33 +0300 |
---|---|---|
committer | Dominik Ritter <dritter03@googlemail.com> | 2018-07-24 17:24:33 +0300 |
commit | 4972f0b8eba711f0dafc46cdbb4e191d550da091 (patch) | |
tree | cac634f7706fc43973785ca467c2285423608d39 /test/segments/rust_version.spec | |
parent | 822b820a6e0d7cec4ec60de23faecec6b77712b6 (diff) |
Improve tests by making use of local variables
Diffstat (limited to 'test/segments/rust_version.spec')
-rwxr-xr-x | test/segments/rust_version.spec | 11 |
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 |