From 9ff06f61b60c461b78ad46d448c932e74b209fca Mon Sep 17 00:00:00 2001 From: "Yamashita, Yuu" Date: Fri, 3 Nov 2017 09:43:02 +0000 Subject: [PATCH] Fix broken tests --- plugins/python-build/test/build.bats | 117 ++++++++++++--------- plugins/python-build/test/compiler.bats | 28 ++--- plugins/python-build/test/test_helper.bash | 2 +- 3 files changed, 75 insertions(+), 72 deletions(-) diff --git a/plugins/python-build/test/build.bats b/plugins/python-build/test/build.bats index b86168ee..69afb6f4 100644 --- a/plugins/python-build/test/build.bats +++ b/plugins/python-build/test/build.bats @@ -63,17 +63,18 @@ assert_build_log() { cached_tarball "yaml-0.1.6" cached_tarball "Python-3.6.2" + # pyenv/pyenv#1026 + stub uname false false + + stub uname '-s : echo Linux' stub brew false stub_make_install stub_make_install - # yyuu/pyenv#257 - stub uname '-s : echo Linux' - stub uname '-s : echo Linux' - install_fixture definitions/needs-yaml assert_success + unstub uname unstub make assert_build_log <> build.log' - # yyuu/pyenv#257 - stub uname '-s : echo Linux' - stub uname '-s : echo Linux' - TMPDIR="$TMP" install_fixture --patch definitions/needs-yaml <<<"" assert_success + unstub uname unstub make unstub patch @@ -124,18 +126,19 @@ OUT cached_tarball "yaml-0.1.6" cached_tarball "Python-3.6.2" + stub uname '-s : echo Linux' stub brew false stub_make_install stub_make_install stub patch ' : echo patch "$@" | sed -E "s/\.[[:alnum:]]+$/.XXX/" >> build.log' - # yyuu/pyenv#257 - stub uname '-s : echo Linux' - stub uname '-s : echo Linux' + # pyenv/pyenv#1026 + stub uname false false TMPDIR="$TMP" install_fixture --patch definitions/needs-yaml <<<"diff --git a/script.py" assert_success + unstub uname unstub make unstub patch @@ -158,16 +161,17 @@ OUT brew_libdir="$TMP/homebrew-yaml" mkdir -p "$brew_libdir" + # pyenv/pyenv#1026 + stub uname false false + + stub uname '-s : echo Linux' stub brew "--prefix libyaml : echo '$brew_libdir'" false stub_make_install - # yyuu/pyenv#257 - stub uname '-s : echo Linux' - stub uname '-s : echo Linux' - install_fixture definitions/needs-yaml assert_success + unstub uname unstub brew unstub make @@ -185,13 +189,12 @@ OUT readline_libdir="$TMP/homebrew-readline" mkdir -p "$readline_libdir" + # pyenv/pyenv#1026 + stub uname false false + stub brew "--prefix readline : echo '$readline_libdir'" stub_make_install - # yyuu/pyenv#257 - stub uname '-s : echo Linux' - stub uname '-s : echo Linux' - run_inline_definition <> build.log' stub_make_install @@ -454,6 +466,7 @@ install_package "Python-3.6.2" "http://python.org/ftp/python/3.6.2/Python-3.6.2. DEF assert_success + unstub uname unstub make unstub apply diff --git a/plugins/python-build/test/compiler.bats b/plugins/python-build/test/compiler.bats index 3b482838..15818d19 100644 --- a/plugins/python-build/test/compiler.bats +++ b/plugins/python-build/test/compiler.bats @@ -8,16 +8,13 @@ export -n CC export -n PYTHON_CONFIGURE_OPTS @test "require_gcc on OS X 10.9" { - # yyuu/pyenv#222 - stub uname '-s : echo Darwin' + # pyenv/pyenv#1026 + stub uname false '-s : echo Darwin' stub sw_vers '-productVersion : echo 10.9.5' - # yyuu/pyenv#257 - stub uname '-s : echo Darwin' - stub uname '-s : echo Darwin' stub sw_vers '-productVersion : echo 10.9.5' - stub gcc '--version : echo 4.2.1' + stub gcc '--version : echo 4.2.1' '--version : echo 4.2.1' run_inline_definition <&2; echo 4.2.1' + stub gcc '--version : echo warning >&2; echo 4.2.1' '--version : echo warning >&2; echo 4.2.1' run_inline_definition <