From 89ea56f55323d4bb1f12b2f0d728ff0cc7d017f9 Mon Sep 17 00:00:00 2001 From: Bruno Sutic Date: Sat, 24 May 2014 23:18:37 +0200 Subject: [PATCH] Change indentation to tabs --- test/run | 14 +++---- test/tests/helpers.sh | 58 +++++++++++++------------- test/tests/test_plugin_installation.sh | 16 +++---- test/tests/test_plugin_sourcing.sh | 14 +++---- 4 files changed, 51 insertions(+), 51 deletions(-) diff --git a/test/run b/test/run index e7bc541..318f1df 100755 --- a/test/run +++ b/test/run @@ -3,21 +3,21 @@ CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" run_vagrant() { - vagrant up --provider=docker + vagrant up --provider=docker } stop_vagrant() { - vagrant destroy -f + vagrant destroy -f } run_tests() { - # actually this test file should be run inside vagrant - $CURRENT_DIR/tests/test_plugin_installation.sh + # actually this test file should be run inside vagrant + $CURRENT_DIR/tests/test_plugin_installation.sh } main() { - run_vagrant - run_tests - stop_vagrant + run_vagrant + run_tests + stop_vagrant } main diff --git a/test/tests/helpers.sh b/test/tests/helpers.sh index 4965fb5..207fafc 100644 --- a/test/tests/helpers.sh +++ b/test/tests/helpers.sh @@ -1,46 +1,46 @@ #!/usr/bin/env bash set_tmux_conf_helper() { - > ~/.tmux.conf # empty filename - while read -r line; do - echo $line >> ~/.tmux.conf - done + > ~/.tmux.conf # empty filename + while read -r line; do + echo $line >> ~/.tmux.conf + done } create_test_plugin_helper() { - local plugin_path="$HOME/.tmux/plugins/tmux_test_plugin/" - rm -rf $plugin_path - mkdir -p $plugin_path + local plugin_path="$HOME/.tmux/plugins/tmux_test_plugin/" + rm -rf $plugin_path + mkdir -p $plugin_path - while read -r line; do - echo $line >> "$plugin_path/test_plugin.tmux" - done - chmod +x "$plugin_path/test_plugin.tmux" + while read -r line; do + echo $line >> "$plugin_path/test_plugin.tmux" + done + chmod +x "$plugin_path/test_plugin.tmux" } teardown_helper() { - rm ~/.tmux.conf - rm -rf ~/.tmux/ - tmux kill-server >/dev/null 2>&1 + rm ~/.tmux.conf + rm -rf ~/.tmux/ + tmux kill-server >/dev/null 2>&1 } check_dir_exists_helper() { - local dir_path=$1 - if [ -d "$dir_path" ]; then - return 0 - else - return 1 - fi + local dir_path=$1 + if [ -d "$dir_path" ]; then + return 0 + else + return 1 + fi } exit_value_helper() { - if $FAIL; then - echo - echo "Test failed" - exit 1 - else - echo - echo "Test finished successfully" - exit 0 - fi + if $FAIL; then + echo + echo "Test failed" + exit 1 + else + echo + echo "Test finished successfully" + exit 0 + fi } diff --git a/test/tests/test_plugin_installation.sh b/test/tests/test_plugin_installation.sh index e22d9cb..57a8731 100755 --- a/test/tests/test_plugin_installation.sh +++ b/test/tests/test_plugin_installation.sh @@ -12,19 +12,19 @@ test_plugin_installation() { run-shell '~/tmux_plugin_manager/tpm' HERE - # opens tmux and test it with `expect` - $CURRENT_DIR/expect_successful_plugin_download || - (echo "Tmux plugin installation fails" >&2; FAIL=true) + # opens tmux and test it with `expect` + $CURRENT_DIR/expect_successful_plugin_download || + (echo "Tmux plugin installation fails" >&2; FAIL=true) - # check plugin dir exists after download - check_dir_exists_helper "/root/.tmux/plugins/tmux_example_plugin/" || - (echo "Plugin download fails" >&2; FAIL=true) + # check plugin dir exists after download + check_dir_exists_helper "/root/.tmux/plugins/tmux_example_plugin/" || + (echo "Plugin download fails" >&2; FAIL=true) teardown_helper } main() { - test_plugin_installation - exit_value_helper + test_plugin_installation + exit_value_helper } main diff --git a/test/tests/test_plugin_sourcing.sh b/test/tests/test_plugin_sourcing.sh index 41d455a..0f89f7f 100755 --- a/test/tests/test_plugin_sourcing.sh +++ b/test/tests/test_plugin_sourcing.sh @@ -7,8 +7,8 @@ source $CURRENT_DIR/helpers.sh export FAIL=false check_binding_defined() { - local binding=$1 - tmux list-keys | grep -q "$binding" + local binding=$1 + tmux list-keys | grep -q "$binding" } test_plugin_sourcing() { @@ -22,15 +22,15 @@ test_plugin_sourcing() { tmux bind-key R run-shell foo_command HERE - tmux new-session -d # tmux starts detached - check_binding_defined 'R run-shell foo_command' || - (echo "Plugin sourcing fails" >&2; FAIL=true) + tmux new-session -d # tmux starts detached + check_binding_defined 'R run-shell foo_command' || + (echo "Plugin sourcing fails" >&2; FAIL=true) teardown_helper } main() { - test_plugin_sourcing - exit_value_helper + test_plugin_sourcing + exit_value_helper } main