improve versions tests by cd'ing into a clean slate

This commit is contained in:
Mislav Marohnić 2013-04-16 12:52:42 +02:00
parent 05568496c1
commit bc1049f5ae

View file

@ -6,6 +6,11 @@ create_version() {
mkdir -p "${RBENV_ROOT}/versions/$1" mkdir -p "${RBENV_ROOT}/versions/$1"
} }
setup() {
mkdir -p "$RBENV_TEST_DIR"
cd "$RBENV_TEST_DIR"
}
@test "no versions installed" { @test "no versions installed" {
assert [ ! -d "${RBENV_ROOT}/versions" ] assert [ ! -d "${RBENV_ROOT}/versions" ]
run rbenv-versions run rbenv-versions
@ -87,8 +92,6 @@ OUT
@test "per-project version" { @test "per-project version" {
create_version "1.9.3" create_version "1.9.3"
create_version "2.0.0" create_version "2.0.0"
mkdir -p "$RBENV_TEST_DIR"
cd "$RBENV_TEST_DIR"
cat > ".ruby-version" <<<"1.9.3" cat > ".ruby-version" <<<"1.9.3"
run rbenv-versions run rbenv-versions
assert_success assert_success