From 822b86942c4ffb0dbf7fd096584d2970675f3ebc Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Sat, 13 Aug 2016 19:26:36 +0900 Subject: [PATCH] [test] Clear environment variables --- test/test_go.rb | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/test/test_go.rb b/test/test_go.rb index d66d39f..00b9c88 100644 --- a/test/test_go.rb +++ b/test/test_go.rb @@ -36,6 +36,10 @@ end class Shell class << self + def unsets + 'unset FZF_DEFAULT_COMMAND FZF_DEFAULT_OPTS FZF_CTRL_T_COMMAND FZF_CTRL_T_OPTS FZF_ALT_C_COMMAND FZF_ALT_C_OPTS FZF_CTRL_R_OPTS;' + end + def bash 'PS1= PROMPT_COMMAND= bash --rcfile ~/.fzf.bash' end @@ -45,6 +49,10 @@ class Shell FileUtils.cp File.expand_path('~/.fzf.zsh'), '/tmp/fzf-zsh/.zshrc' 'PS1= PROMPT_COMMAND= HISTSIZE=100 ZDOTDIR=/tmp/fzf-zsh zsh' end + + def fish + 'fish' + end end end @@ -57,11 +65,11 @@ class Tmux @win = case shell when :bash - go("new-window -d -P -F '#I' '#{Shell.bash}'").first + go("new-window -d -P -F '#I' '#{Shell.unsets + Shell.bash}'").first when :zsh - go("new-window -d -P -F '#I' '#{Shell.zsh}'").first + go("new-window -d -P -F '#I' '#{Shell.unsets + Shell.zsh}'").first when :fish - go("new-window -d -P -F '#I' 'fish'").first + go("new-window -d -P -F '#I' '#{Shell.unsets + Shell.fish}'").first else raise "Unknown shell: #{shell}" end @@ -153,12 +161,6 @@ class TestBase < Minitest::Test @temp_suffix].join '-' end - def setup - ENV.delete 'FZF_DEFAULT_OPTS' - ENV.delete 'FZF_CTRL_T_COMMAND' - ENV.delete 'FZF_DEFAULT_COMMAND' - end - def readonce wait { File.exists?(tempname) } File.read(tempname)