summaryrefslogtreecommitdiff
path: root/test/segments/dir.spec
diff options
context:
space:
mode:
authorDominik Ritter <dritter03@googlemail.com>2018-07-19 09:22:58 +0300
committerDominik Ritter <dritter03@googlemail.com>2018-07-19 22:47:29 +0300
commit7bfa471e41a225b858fcf43da255bc5962351fd9 (patch)
treeeaa9eb1f0da0c8d4dfe6c204d0cd395d5de218f6 /test/segments/dir.spec
parentcf353f5660c6b11220032264a3e9635a12e5e451 (diff)
Fix tests for dir segment on OSX
Diffstat (limited to 'test/segments/dir.spec')
-rwxr-xr-xtest/segments/dir.spec10
1 files changed, 9 insertions, 1 deletions
diff --git a/test/segments/dir.spec b/test/segments/dir.spec
index b5fce59f..3e66e918 100755
--- a/test/segments/dir.spec
+++ b/test/segments/dir.spec
@@ -22,7 +22,15 @@ function testDirPathAbsoluteWorks() {
POWERLEVEL9K_DIR_PATH_ABSOLUTE=true
cd ~
- assertEquals "%K{blue} %F{black}/home/travis %k%F{blue}%f " "$(build_left_prompt)"
+
+ # Unfortunately, we cannot fake Linux or OSX here, because
+ # of /home or /Users path.. That is why we change the test
+ # according to the OS of the host.
+ if [[ "${OS}" == 'Linux' ]]; then
+ assertEquals "%K{blue} %F{black}/home/${USER} %k%F{blue}%f " "$(build_left_prompt)"
+ elif [[ "${OS}" == 'OSX' ]]; then
+ assertEquals "%K{blue} %F{black}/Users/${USER} %k%F{blue}%f " "$(build_left_prompt)"
+ fi
cd -
unset POWERLEVEL9K_DIR_PATH_ABSOLUTE