From a3ff3adc391c25a82247d441215a1042dd5c61c5 Mon Sep 17 00:00:00 2001 From: Jason Karns Date: Fri, 20 Nov 2015 09:51:21 -0500 Subject: [PATCH] create local .ruby-version file in test dir This new test was creating an (intentionally invalid) .ruby-version file in current working directory; typically the rbenv project dir. Immediately after test runs, I had a leftover .ruby-version file. The version-file tests create and cd into the RBENV_TEST_DIR as part of setup(). I'm using the same directory for this test fix, but am only using it for this particular test. None of the other exec tests seem to need to be in a temp test dir, so no use putting it in setup(). --- test/exec.bats | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/exec.bats b/test/exec.bats index 28003794..aeb0456c 100644 --- a/test/exec.bats +++ b/test/exec.bats @@ -21,6 +21,8 @@ create_executable() { } @test "fails with invalid version set from file" { + mkdir -p "$RBENV_TEST_DIR" + cd "$RBENV_TEST_DIR" echo 1.9 > .ruby-version run rbenv-exec rspec assert_failure "rbenv: version \`1.9' is not installed (set by $PWD/.ruby-version)"