pyenv/test/prefix.bats
Mislav Marohnić bb6bccb782 tests galore
2013-03-07 15:07:32 -05:00

25 lines
632 B
Bash

#!/usr/bin/env bats
load test_helper
@test "prefix" {
mkdir -p "${RBENV_TEST_DIR}/myproject"
cd "${RBENV_TEST_DIR}/myproject"
echo "1.2.3" > .ruby-version
mkdir -p "${RBENV_ROOT}/versions/1.2.3"
run rbenv-prefix
assert_success "${RBENV_ROOT}/versions/1.2.3"
}
@test "prefix for invalid version" {
RBENV_VERSION="1.2.3" run rbenv-prefix
assert_failure "rbenv: version \`1.2.3' not installed"
}
@test "prefix for system" {
mkdir -p "${RBENV_TEST_DIR}/bin"
touch "${RBENV_TEST_DIR}/bin/ruby"
chmod +x "${RBENV_TEST_DIR}/bin/ruby"
RBENV_VERSION="system" run rbenv-prefix
assert_success "$RBENV_TEST_DIR"
}