From bc1049f5aec5590d198e6995ccdce9dd49e4fa3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mislav=20Marohnic=CC=81?= Date: Tue, 16 Apr 2013 12:52:42 +0200 Subject: [PATCH] improve `versions` tests by cd'ing into a clean slate --- test/versions.bats | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/test/versions.bats b/test/versions.bats index cdec7a8a..11acdfc8 100644 --- a/test/versions.bats +++ b/test/versions.bats @@ -6,6 +6,11 @@ create_version() { mkdir -p "${RBENV_ROOT}/versions/$1" } +setup() { + mkdir -p "$RBENV_TEST_DIR" + cd "$RBENV_TEST_DIR" +} + @test "no versions installed" { assert [ ! -d "${RBENV_ROOT}/versions" ] run rbenv-versions @@ -87,8 +92,6 @@ OUT @test "per-project version" { create_version "1.9.3" create_version "2.0.0" - mkdir -p "$RBENV_TEST_DIR" - cd "$RBENV_TEST_DIR" cat > ".ruby-version" <<<"1.9.3" run rbenv-versions assert_success