From 2dbf0c220fc971c9493392a70c71954001fee7fd Mon Sep 17 00:00:00 2001 From: Claudio Bandera Date: Sun, 30 Aug 2015 23:04:16 +0200 Subject: Fixed unittests for Ubuntu --- test-commits.sh | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'test-commits.sh') diff --git a/test-commits.sh b/test-commits.sh index 95addf9..89a1ba1 100755 --- a/test-commits.sh +++ b/test-commits.sh @@ -1,3 +1,4 @@ +#!/bin/bash scriptDir="$(cd "$(dirname "$0")"; pwd)" source "$scriptDir/radar-base.sh" @@ -14,7 +15,6 @@ rm_tmp() { cd $scriptDir rm -rf /tmp/git-prompt-tests* } - test_commits_with_no_commits() { cd_to_tmp git init --quiet @@ -222,7 +222,6 @@ test_remote_branch_starts_with_local_branch_name() { rm_tmp } - test_remote_branch_ends_with_local_branch_name() { cd_to_tmp "remote" git init --bare --quiet @@ -297,11 +296,10 @@ test_dont_call_remote_branch_name() { usages="$(echo "$debug_output" | grep 'remote_branch_name' | wc -l )" #wc -l has a weird output - assertEquals " 0" "$usages" + assertEquals "0" "$usages" rm_tmp } - test_dont_remote_if_remote_is_master() { cd_to_tmp git init --quiet @@ -322,7 +320,7 @@ test_dont_remote_if_remote_is_master() { usages="$(echo "$debug_output" | grep 'git rev-list' | wc -l )" - assertEquals " 0" "$usages" + assertEquals "0" "$usages" rm_tmp } -- cgit v1.2.3 From e692cbc483f8ee4b4666143fe1b3cfbd86e7681f Mon Sep 17 00:00:00 2001 From: Claudio Bandera Date: Thu, 17 Sep 2015 20:35:34 +0200 Subject: Added switch case for OS type in tests --- test-commits.sh | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'test-commits.sh') diff --git a/test-commits.sh b/test-commits.sh index 8eecffc..c97c56a 100755 --- a/test-commits.sh +++ b/test-commits.sh @@ -296,7 +296,12 @@ test_dont_call_remote_branch_name() { usages="$(echo "$debug_output" | grep 'remote_branch_name' | wc -l )" #wc -l has a weird output - assertEquals "0" "$usages" + if [[ $OSTYPE == darwin* ]];then + expected=" 0" + else + expected="0" + fi; + assertEquals "$expected" "$usages" rm_tmp } @@ -320,7 +325,12 @@ test_dont_remote_if_remote_is_master() { usages="$(echo "$debug_output" | grep 'git rev-list' | wc -l )" - assertEquals "0" "$usages" + if [[ $OSTYPE == darwin* ]];then + expected=" 0" + else + expected="0" + fi; + assertEquals "$expected" "$usages" rm_tmp } -- cgit v1.2.3