From f9d8b551dc2afa82e98d0779d1c6e4eebace74f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mislav=20Marohni=C4=87?= Date: Thu, 24 Dec 2015 12:29:35 +0100 Subject: [PATCH] Add test for detecting shell when `rbenv init` is called from script References #730 --- test/init.bats | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/test/init.bats b/test/init.bats index 0a46dd0d..d7005489 100644 --- a/test/init.bats +++ b/test/init.bats @@ -25,12 +25,24 @@ load test_helper } @test "detect parent shell" { - root="$(cd $BATS_TEST_DIRNAME/.. && pwd)" SHELL=/bin/false run rbenv-init - assert_success assert_line "export RBENV_SHELL=bash" } +@test "detect parent shell from script" { + mkdir -p "$RBENV_TEST_DIR" + cd "$RBENV_TEST_DIR" + cat > myscript.sh <