1
0
mirror of https://github.com/pyenv/pyenv.git synced 2025-11-10 12:33:48 -05:00

Fix fetch_git with --keep (sstephenson/ruby-build#549)

This commit is contained in:
Yamashita Yuu
2014-06-09 22:41:43 +09:00
parent 00596b4b46
commit 2ec8f0f0a4
2 changed files with 46 additions and 1 deletions

View File

@@ -4,6 +4,11 @@ load test_helper
export PYTHON_BUILD_SKIP_MIRROR=1
export PYTHON_BUILD_CACHE_PATH=
setup() {
export PYTHON_BUILD_BUILD_PATH="${TMP}/source"
mkdir -p "${PYTHON_BUILD_BUILD_PATH}"
}
@test "failed download displays error message" {
stub curl false
@@ -12,3 +17,36 @@ export PYTHON_BUILD_CACHE_PATH=
assert_output_contains "> http://example.com/packages/package-1.0.0.tar.gz"
assert_output_contains "error: failed to download package-1.0.0.tar.gz"
}
@test "fetching from git repository" {
stub git "clone --depth 1 --branch master http://example.com/packages/package.git package-dev : mkdir package-dev"
run_inline_definition <<DEF
install_git "package-dev" "http://example.com/packages/package.git" master copy
DEF
assert_success
assert_output <<OUT
Cloning http://example.com/packages/package.git...
Installing package-dev...
Installed package-dev to ${TMP}/install
OUT
unstub git
}
@test "updating existing git repository" {
mkdir -p "${PYTHON_BUILD_BUILD_PATH}/package-dev"
stub git \
"fetch --depth 1 origin +master : true" \
"checkout -q -B master origin/master : true"
run_inline_definition <<DEF
install_git "package-dev" "http://example.com/packages/package.git" master copy
DEF
assert_success
assert_output <<OUT
Cloning http://example.com/packages/package.git...
Installing package-dev...
Installed package-dev to ${TMP}/install
OUT
unstub git
}