Commits

Doug Hellmann  committed 3fad348

add tests for GREP_OPTIONS problem (ref #51)

  • Participants
  • Parent commits 5108bba

Comments (0)

Files changed (3)

File docs/en/history.rst

 Dev
 
   - Escape ``which`` calls to avoid aliases. Resolves :bbissue:`46`.
+  - Integrate Manuel Kaufmann's patch to unset GREP_OPTIONS before
+    calling grep.  Resolves :bbissue:`51`.
 
 2.2
 

File tests/test.sh

     WORKON_HOME="$old_home"
 }
 
+test_virtualenvwrapper_verify_workon_home_missing_dir_grep_options() {
+    old_home="$WORKON_HOME"
+    WORKON_HOME="$WORKON_HOME/not_there"
+    # This should prevent the message from being found if it isn't
+    # unset correctly.
+    export GREP_OPTIONS="--count"
+    assertFalse "WORKON_HOME verified unexpectedly" virtualenvwrapper_verify_workon_home
+    WORKON_HOME="$old_home"
+    unset GREP_OPTIONS
+}
+
 test_virtualenvwrapper_verify_workon_home_missing_dir_quiet_init() {
     old_home="$WORKON_HOME"
     export WORKON_HOME="$WORKON_HOME/not_there"

File tests/test_workon.sh

     rm -f "$WORKON_HOME/link_env"
 }
 
+test_virtualenvwrapper_show_workon_options_grep_options () {
+    mkdir "$WORKON_HOME/not_env"
+    (cd "$WORKON_HOME"; ln -s env1 link_env)
+    export GREP_OPTIONS="--count"
+    envs=$(virtualenvwrapper_show_workon_options | tr '\n' ' ')
+    unset GREP_OPTIONS
+    assertSame "env1 env2 link_env " "$envs"
+    rmdir "$WORKON_HOME/not_env"
+    rm -f "$WORKON_HOME/link_env"
+}
+
 test_virtualenvwrapper_show_workon_options_no_envs () {
     old_home="$WORKON_HOME"
     export WORKON_HOME=${TMPDIR:-/tmp}/$$