aboutsummaryrefslogtreecommitdiff
path: root/test/segments/ssh.spec
diff options
context:
space:
mode:
authorDominik Ritter <dritter03@googlemail.com>2018-07-25 08:52:06 +0300
committerDominik Ritter <dritter03@googlemail.com>2018-07-25 08:52:06 +0300
commit06de83cc0f2282b2217c6151277dfd6789593c2e (patch)
tree8e7d013b2f66f9431b732f64fe8c8c5c8a87e7c5 /test/segments/ssh.spec
parent99f0eddd62806f99b8116e3f327689bc32529d5d (diff)
Prepare tests for performance optimizations
Diffstat (limited to 'test/segments/ssh.spec')
-rwxr-xr-xtest/segments/ssh.spec18
1 files changed, 12 insertions, 6 deletions
diff --git a/test/segments/ssh.spec b/test/segments/ssh.spec
index a5360072..a6701dcf 100755
--- a/test/segments/ssh.spec
+++ b/test/segments/ssh.spec
@@ -7,12 +7,6 @@ SHUNIT_PARENT=$0
function setUp() {
export TERM="xterm-256color"
- # Load Powerlevel9k
- source powerlevel9k.zsh-theme
-}
-
-function mockRust() {
- echo 'rustc 0.4.1a-alpha'
}
function testSshSegmentPrintsNothingIfNoSshConnection() {
@@ -25,6 +19,9 @@ function testSshSegmentPrintsNothingIfNoSshConnection() {
unset SSH_CLIENT
unset SSH_TTY
+ # Load Powerlevel9k
+ source powerlevel9k.zsh-theme
+
assertEquals "%K{white} %F{black}world %k%F{white}%f " "$(build_left_prompt)"
}
@@ -37,6 +34,9 @@ function testSshSegmentWorksIfOnlySshClientIsSet() {
SSH_CLIENT='ssh-client'
unset SSH_TTY
+ # Load Powerlevel9k
+ source powerlevel9k.zsh-theme
+
assertEquals "%K{black} %F{yellow%}ssh-icon%f %k%F{black}%f " "$(build_left_prompt)"
unset SSH_CLIENT
@@ -51,6 +51,9 @@ function testSshSegmentWorksIfOnlySshTtyIsSet() {
SSH_TTY='ssh-tty'
unset SSH_CLIENT
+ # Load Powerlevel9k
+ source powerlevel9k.zsh-theme
+
assertEquals "%K{black} %F{yellow%}ssh-icon%f %k%F{black}%f " "$(build_left_prompt)"
unset SSH_TTY
@@ -65,6 +68,9 @@ function testSshSegmentWorksIfAllNecessaryVariablesAreSet() {
SSH_CLIENT='ssh-client'
SSH_TTY='ssh-tty'
+ # Load Powerlevel9k
+ source powerlevel9k.zsh-theme
+
assertEquals "%K{black} %F{yellow%}ssh-icon%f %k%F{black}%f " "$(build_left_prompt)"
unset SSH_TTY