diff options
author | Dominik Ritter <dritter03@googlemail.com> | 2018-07-25 08:52:06 +0300 |
---|---|---|
committer | Dominik Ritter <dritter03@googlemail.com> | 2018-07-25 08:52:06 +0300 |
commit | 06de83cc0f2282b2217c6151277dfd6789593c2e (patch) | |
tree | 8e7d013b2f66f9431b732f64fe8c8c5c8a87e7c5 /test/segments/aws_eb_env.spec | |
parent | 99f0eddd62806f99b8116e3f327689bc32529d5d (diff) |
Prepare tests for performance optimizations
Diffstat (limited to 'test/segments/aws_eb_env.spec')
-rwxr-xr-x | test/segments/aws_eb_env.spec | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/test/segments/aws_eb_env.spec b/test/segments/aws_eb_env.spec index 56042027..42740ea6 100755 --- a/test/segments/aws_eb_env.spec +++ b/test/segments/aws_eb_env.spec @@ -7,24 +7,30 @@ SHUNIT_PARENT=$0 function setUp() { export TERM="xterm-256color" - # Load Powerlevel9k - source powerlevel9k.zsh-theme } function testAwsEbEnvSegmentPrintsNothingIfNoElasticBeanstalkEnvironmentIsSet() { local POWERLEVEL9K_CUSTOM_WORLD='echo world' - local POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(aws_eb_env custom_world) + local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS + POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(aws_eb_env custom_world) + + # Load Powerlevel9k + source powerlevel9k.zsh-theme assertEquals "%K{white} %F{black}world %k%F{white}%f " "$(build_left_prompt)" } function testAwsEbEnvSegmentWorksIfElasticBeanstalkEnvironmentIsSet() { + local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS + POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(aws_eb_env) + + # Load Powerlevel9k + source powerlevel9k.zsh-theme + mkdir -p /tmp/powerlevel9k-test/.elasticbeanstalk echo "test:\n environment: test" > /tmp/powerlevel9k-test/.elasticbeanstalk/config.yml cd /tmp/powerlevel9k-test - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(aws_eb_env) - assertEquals "%K{black} %F{green%}🌱 %f%F{green}test %k%F{black}%f " "$(build_left_prompt)" rm -fr /tmp/powerlevel9k-test @@ -35,14 +41,17 @@ function testAwsEbEnvSegmentWorksIfElasticBeanstalkEnvironmentIsSetInParentDirec # Skip test, because currently we cannot detect # if the configuration is in a parent directory startSkipping # Skip test + local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS + POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(aws_eb_env) + + # Load Powerlevel9k + source powerlevel9k.zsh-theme + mkdir -p /tmp/powerlevel9k-test/.elasticbeanstalk mkdir -p /tmp/powerlevel9k-test/1/12/123/1234/12345 echo "test:\n environment: test" > /tmp/powerlevel9k-test/.elasticbeanstalk/config.yml cd /tmp/powerlevel9k-test/1/12/123/1234/12345 - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(aws_eb_env) - assertEquals "%K{black} %F{green%}🌱 %f%F{green}test %k%F{black}%f " "$(build_left_prompt)" rm -fr /tmp/powerlevel9k-test |