diff --git a/test/version-name.bats b/test/version-name.bats index ef283283..82e1b2d0 100644 --- a/test/version-name.bats +++ b/test/version-name.bats @@ -2,13 +2,6 @@ load test_helper -export RBENV_HOOK_PATH="${RBENV_ROOT}/rbenv.d" - -create_hook() { - mkdir -p "${RBENV_ROOT}/rbenv.d/version-name" - cat > "${RBENV_ROOT}/rbenv.d/version-name/$1" <<<"$2" -} - create_version() { mkdir -p "${RBENV_ROOT}/versions/$1" } @@ -33,11 +26,12 @@ setup() { create_version "1.8.7" create_version "1.9.3" - RBENV_VERSION=1.8.7 run rbenv-version-name - assert_success "1.8.7" + mkdir -p "${RBENV_ROOT}/rbenv.d/version-name" + cat > "${RBENV_ROOT}/rbenv.d/version-name/test.bash" < "${RBENV_ROOT}/rbenv.d/version-origin/$1" <<<"$2" -} - setup() { mkdir -p "$RBENV_TEST_DIR" cd "$RBENV_TEST_DIR" @@ -45,11 +38,12 @@ setup() { } @test "reports from hook" { - touch .ruby-version - create_hook test.bash "RBENV_VERSION_ORIGIN=plugin" - - RBENV_VERSION=1 run rbenv-version-origin + mkdir -p "${RBENV_ROOT}/rbenv.d/version-origin" + cat > "${RBENV_ROOT}/rbenv.d/version-origin/test.bash" <