Added tests for additional SVN scenarios
parent
47f6682292
commit
f933a86ff0
|
|
@ -1,3 +1,10 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
# If the info command is called
|
||||||
|
# AND the parent folder contains the .svn folder
|
||||||
|
# THEN return the current path, similar to what `svn info` does
|
||||||
|
if [[ "$1" = "info" ]] && [[ -d "../.svn" ]]; then
|
||||||
|
echo "$PWD"
|
||||||
|
fi
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
|
|
||||||
|
|
@ -64,6 +64,43 @@ reset_svn_path() {
|
||||||
reset_svn_path
|
reset_svn_path
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@test 'themes base: SVN: detect SVN repo even from a subfolder' {
|
||||||
|
repo="$(setup_repo)"
|
||||||
|
pushd "$repo"
|
||||||
|
|
||||||
|
mkdir foo
|
||||||
|
pushd foo
|
||||||
|
|
||||||
|
setup_svn_path "$BASH_IT/test/fixtures/svn/working"
|
||||||
|
|
||||||
|
# Load the base theme again so that the working SVN script is detected
|
||||||
|
load ../../themes/base.theme
|
||||||
|
|
||||||
|
scm
|
||||||
|
# Make sure that the SVN command is used
|
||||||
|
assert_equal "$SCM" "$SCM_SVN"
|
||||||
|
|
||||||
|
reset_svn_path
|
||||||
|
}
|
||||||
|
|
||||||
|
@test 'themes base: SVN: no SCM if no .svn folder can be found' {
|
||||||
|
repo="$(setup_repo)"
|
||||||
|
pushd "$repo"
|
||||||
|
|
||||||
|
rm -rf .svn
|
||||||
|
|
||||||
|
setup_svn_path "$BASH_IT/test/fixtures/svn/working"
|
||||||
|
|
||||||
|
# Load the base theme again so that the working SVN script is detected
|
||||||
|
load ../../themes/base.theme
|
||||||
|
|
||||||
|
scm
|
||||||
|
# Make sure that the SVN command is used
|
||||||
|
assert_equal "$SCM" "$SCM_NONE"
|
||||||
|
|
||||||
|
reset_svn_path
|
||||||
|
}
|
||||||
|
|
||||||
@test 'themes base: SVN: ignore SVN repo when using broken SVN command' {
|
@test 'themes base: SVN: ignore SVN repo when using broken SVN command' {
|
||||||
repo="$(setup_repo)"
|
repo="$(setup_repo)"
|
||||||
pushd "$repo"
|
pushd "$repo"
|
||||||
|
|
@ -79,3 +116,22 @@ reset_svn_path() {
|
||||||
|
|
||||||
reset_svn_path
|
reset_svn_path
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@test 'themes base: SVN: ignore SVN repo even from a subfolder when using a broken SVN' {
|
||||||
|
repo="$(setup_repo)"
|
||||||
|
pushd "$repo"
|
||||||
|
|
||||||
|
mkdir foo
|
||||||
|
pushd foo
|
||||||
|
|
||||||
|
setup_svn_path "$BASH_IT/test/fixtures/svn/broken"
|
||||||
|
|
||||||
|
# Load the base theme again so that the working SVN script is detected
|
||||||
|
load ../../themes/base.theme
|
||||||
|
|
||||||
|
scm
|
||||||
|
# Make sure that the SVN command is used
|
||||||
|
assert_equal "$SCM" "$SCM_NONE"
|
||||||
|
|
||||||
|
reset_svn_path
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue