postmodern / chruby

Changes the current Ruby
MIT License
2.86k stars 190 forks source link

zsh/test_chruby_exec fails when run under pbuilder #336

Open x-yuri opened 9 years ago

x-yuri commented 9 years ago

See for yourself:

>>> Running ./test/chruby_exec_test.sh ...
test_chruby_exec_no_arguments
test_chruby_exec_no_command
test_chruby_exec
zsh:1: command not found: chruby
ASSERT:did change the ruby expected:<2.0.0> but was:<>

As it turns out it has something to do with [ -t 0 ] which is false under pbuilder. When run manually, the test passes.

x-yuri commented 9 years ago

I now see, running chruby works out because chruby.sh is included in .zshrc and .bashrc. But .zshrc is run only for interactive shells. The bash tests pass because .bashrc is included in .bash_profile.

postmodern commented 9 years ago

Should we add a .zlogin file which should be loaded in login mode?

x-yuri commented 9 years ago

I was thinking of adding .zprofile, and sourcing .zshrc there. But using .zlogin will supposedly work out as well.

amomchilov commented 6 months ago

Related issue: https://github.com/postmodern/chruby/issues/502

Works fine on master, but not 0.39.0.