2014-10-29 06:35:29 -04:00
|
|
|
#!/usr/bin/env bats
|
|
|
|
|
|
|
|
load test_helper
|
|
|
|
|
|
|
|
bats_bin="${BATS_TEST_DIRNAME}/../bin/python-build"
|
2023-02-22 12:11:48 -05:00
|
|
|
static_version="$(grep VERSION "$bats_bin" | head -n1 | cut -d'"' -f 2)"
|
2014-10-29 06:35:29 -04:00
|
|
|
|
|
|
|
@test "python-build static version" {
|
|
|
|
stub git 'echo "ASPLODE" >&2; exit 1'
|
|
|
|
run python-build --version
|
|
|
|
assert_success "python-build ${static_version}"
|
|
|
|
unstub git
|
|
|
|
}
|
|
|
|
|
|
|
|
@test "python-build git version" {
|
|
|
|
stub git \
|
2017-03-05 23:31:25 -05:00
|
|
|
'remote -v : echo origin https://github.com/pyenv/pyenv.git' \
|
2014-10-29 06:35:29 -04:00
|
|
|
"describe --tags HEAD : echo v1984-12-gSHA"
|
|
|
|
run python-build --version
|
|
|
|
assert_success "python-build 1984-12-gSHA"
|
|
|
|
unstub git
|
|
|
|
}
|
|
|
|
|
|
|
|
@test "git describe fails" {
|
|
|
|
stub git \
|
2017-03-05 23:31:25 -05:00
|
|
|
'remote -v : echo origin https://github.com/pyenv/pyenv.git' \
|
2014-10-29 06:35:29 -04:00
|
|
|
"describe --tags HEAD : echo ASPLODE >&2; exit 1"
|
|
|
|
run python-build --version
|
|
|
|
assert_success "python-build ${static_version}"
|
|
|
|
unstub git
|
|
|
|
}
|
|
|
|
|
|
|
|
@test "git remote doesn't match" {
|
|
|
|
stub git \
|
2021-09-20 00:43:08 -04:00
|
|
|
'remote -v : echo origin https://github.com/Homebrew/homebrew.git'
|
2014-10-29 06:35:29 -04:00
|
|
|
run python-build --version
|
|
|
|
assert_success "python-build ${static_version}"
|
|
|
|
}
|