diff options
Diffstat (limited to 'test/cases/gitget.bats')
-rw-r--r-- | test/cases/gitget.bats | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/test/cases/gitget.bats b/test/cases/gitget.bats new file mode 100644 index 0000000..1630fdb --- /dev/null +++ b/test/cases/gitget.bats @@ -0,0 +1,40 @@ +#!/usr/bin/env roundup + +describe gitget +. ./test-common.sh + +it_displays_help() { + LC_ALL=C gitget -h >$tmpdir/stdout 2>$tmpdir/stderr + + [[ "$(sed 1q $tmpdir/stdout)" =~ Usage:.* ]] + empty $tmpdir/stderr +} + +it_fails_with_0_args() { + gitget >$tmpdir/stdout 2>$tmpdir/stderr || status=$? + + [[ $status != 0 ]] + empty $tmpdir/stdout + not empty $tmpdir/stderr +} + +it_forces_url_for_bare() { + mkdir "$tmpdir/src" + cd "$tmpdir/src" + git init . + git config --local user.email 'libretools-test@localhost' + git config --local user.name 'Test Suite' + echo a > a + git add . + git commit -m 'initial commit' + cd .. + gitget bare src dst.git + cd dst.git + [[ "$(git config --get remote.origin.url)" == "$tmpdir/src" ]] + cd .. + gitget bare "file://$PWD/src" dst.git || status=$? + [[ $status != 0 ]] + gitget -f bare "file://$PWD/src" dst.git + cd dst.git + [[ "$(git config --get remote.origin.url)" == "file://$tmpdir/src" ]] +} |