mirror of
https://github.com/pyenv/pyenv.git
synced 2024-11-07 20:31:01 -05:00
Add test for detecting shell when rbenv init
is called from script
References #730
This commit is contained in:
parent
2c7960102c
commit
f9d8b551dc
1 changed files with 13 additions and 1 deletions
|
@ -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 <<OUT
|
||||
#!/bin/sh
|
||||
eval "\$(rbenv-init -)"
|
||||
echo \$RBENV_SHELL
|
||||
OUT
|
||||
chmod +x myscript.sh
|
||||
run ./myscript.sh /bin/zsh
|
||||
assert_success "sh"
|
||||
}
|
||||
|
||||
@test "setup shell completions (fish)" {
|
||||
root="$(cd $BATS_TEST_DIRNAME/.. && pwd)"
|
||||
run rbenv-init - fish
|
||||
|
|
Loading…
Reference in a new issue