diff options
| author | Mike McQuaid | 2017-02-23 09:12:18 +0000 |
|---|---|---|
| committer | GitHub | 2017-02-23 09:12:18 +0000 |
| commit | 1a436b4d24d50011bc444cf5d2016f5c0f808dec (patch) | |
| tree | 9659fbe8f1ed557e74ddaf7fde9c3c8ff8821da2 /Library/Homebrew/test/shell_test.rb | |
| parent | 5e9057500419d1a2b41efe784e9f12ae232e7f6e (diff) | |
| parent | 3f8e52e5742cdd3d992ddee79741a4c4e45ab4bf (diff) | |
| download | brew-1a436b4d24d50011bc444cf5d2016f5c0f808dec.tar.bz2 | |
Merge branch 'master' into mirror_audit
Diffstat (limited to 'Library/Homebrew/test/shell_test.rb')
| -rw-r--r-- | Library/Homebrew/test/shell_test.rb | 56 |
1 files changed, 0 insertions, 56 deletions
diff --git a/Library/Homebrew/test/shell_test.rb b/Library/Homebrew/test/shell_test.rb deleted file mode 100644 index 970489702..000000000 --- a/Library/Homebrew/test/shell_test.rb +++ /dev/null @@ -1,56 +0,0 @@ -require "testing_env" -require "utils/shell" - -class ShellSmokeTest < Homebrew::TestCase - def test_path_to_shell - # raw command name - assert_equal :bash, Utils::Shell.path_to_shell("bash") - # full path - assert_equal :bash, Utils::Shell.path_to_shell("/bin/bash") - # versions - assert_equal :zsh, Utils::Shell.path_to_shell("zsh-5.2") - # strip newline too - assert_equal :zsh, Utils::Shell.path_to_shell("zsh-5.2\n") - end - - def test_path_to_shell_failure - assert_nil Utils::Shell.path_to_shell("") - assert_nil Utils::Shell.path_to_shell("@@@@@@") - assert_nil Utils::Shell.path_to_shell("invalid_shell-4.2") - end - - def test_sh_quote - assert_equal "''", Utils::Shell.sh_quote("") - assert_equal "\\\\", Utils::Shell.sh_quote("\\") - assert_equal "'\n'", Utils::Shell.sh_quote("\n") - assert_equal "\\$", Utils::Shell.sh_quote("$") - assert_equal "word", Utils::Shell.sh_quote("word") - end - - def test_csh_quote - assert_equal "''", Utils::Shell.csh_quote("") - assert_equal "\\\\", Utils::Shell.csh_quote("\\") - # note this test is different than for sh - assert_equal "'\\\n'", Utils::Shell.csh_quote("\n") - assert_equal "\\$", Utils::Shell.csh_quote("$") - assert_equal "word", Utils::Shell.csh_quote("word") - end - - def prepend_path_shell(shell, path, fragment) - ENV["SHELL"] = shell - - prepend_message = Utils::Shell.prepend_path_in_shell_profile(path) - assert( - prepend_message.start_with?(fragment), - "#{shell}: expected #{prepend_message} to match #{fragment}", - ) - end - - def test_prepend_path_in_shell_profile - prepend_path_shell "/bin/tcsh", "/path", "echo 'setenv PATH /path" - - prepend_path_shell "/bin/bash", "/path", "echo 'export PATH=\"/path" - - prepend_path_shell "/usr/local/bin/fish", "/path", "echo 'set -g fish_user_paths \"/path\" $fish_user_paths' >>" - end -end |
