diff --git a/test/colab_test.sh b/test/colab_test.sh index 576339c..eec4e28 100644 --- a/test/colab_test.sh +++ b/test/colab_test.sh @@ -29,4 +29,4 @@ test_reverse_proxy_gitlab() { assertTrue 'Reverse proxy for gitlab' "curl --header 'Host: softwarepublico.dev' http://$integration/gitlab/public/projects | grep -i ''" } -. shunit2 +load_shunit2 diff --git a/test/gitlab_test.sh b/test/gitlab_test.sh index 4ced1ac..834147b 100644 --- a/test/gitlab_test.sh +++ b/test/gitlab_test.sh @@ -22,4 +22,4 @@ test_redirects_to_the_correct_host() { assertEquals "Location: https://softwarepublico.dev/gitlab/users/sign_in" "$redirect" } -. shunit2 +load_shunit2 diff --git a/test/mail_relay_test.sh b/test/mail_relay_test.sh index 707e042..f64f99d 100644 --- a/test/mail_relay_test.sh +++ b/test/mail_relay_test.sh @@ -40,5 +40,5 @@ test_outbound_email_reverseproxy() { _test_outbound_email reverseproxy } -. shunit2 +load_shunit2 diff --git a/test/mailman_api_test.sh b/test/mailman_api_test.sh index b1bd141..c40ce93 100644 --- a/test/mailman_api_test.sh +++ b/test/mailman_api_test.sh @@ -4,5 +4,5 @@ test_mailman_api_running() { assertTrue 'mailman running' 'run_on integration pgrep -fa mailman-api' } -. shunit2 +load_shunit2 diff --git a/test/mailman_test.sh b/test/mailman_test.sh index 15f3597..ccc330c 100644 --- a/test/mailman_test.sh +++ b/test/mailman_test.sh @@ -25,4 +25,4 @@ test_mailman_web_interface() { assertEquals "listas.softwarepublico.dev Mailing Lists" "$title" } -. shunit2 +load_shunit2 diff --git a/test/postgresql_test.sh b/test/postgresql_test.sh index a66b860..6885549 100644 --- a/test/postgresql_test.sh +++ b/test/postgresql_test.sh @@ -12,5 +12,5 @@ test_gitlab_database_created() { assertTrue 'gitlab database created in PostgreSQL' 'run_on database sudo -u postgres -i psql gitlab < /dev/null' } -. shunit2 +load_shunit2 diff --git a/test/redis_test.sh b/test/redis_test.sh index 74957b2..b495fbb 100644 --- a/test/redis_test.sh +++ b/test/redis_test.sh @@ -8,4 +8,4 @@ test_redis_listens_on_local_network() { assertTrue 'redis listening on local network' 'nc -z -w 1 $database 6379' } -. shunit2 +load_shunit2 diff --git a/test/reverse_proxy_test.sh b/test/reverse_proxy_test.sh index f1b63a0..e51c59f 100644 --- a/test/reverse_proxy_test.sh +++ b/test/reverse_proxy_test.sh @@ -15,4 +15,4 @@ test_redirect_http_to_mailman() { assertEquals "listas.softwarepublico.dev Mailing Lists" "$title" } -. shunit2 +load_shunit2 diff --git a/test/test_helper.sh b/test/test_helper.sh index 046c80f..30aa236 100644 --- a/test/test_helper.sh +++ b/test/test_helper.sh @@ -7,4 +7,15 @@ run_on() { echo 'export PATH=/vagrant/test/bin:$PATH;' "$@" | ssh -F .ssh_config "$vm" } +load_shunit2() { + if [ `which shunit2 > /dev/null 2>&1` ]; then + . shunit2 + elif [ -e /usr/share/shunit2/shunit2 ]; then + . /usr/share/shunit2/shunit2 + else + echo "Could not find shunit2, please, make sure you have it installed." + fi +} + . $(dirname $0)/ip_helper.sh + -- libgit2 0.21.2