Doug Hellmann committed b881427

fix lazy-loader function definitions under zsh; fixes #144

Comments (0)

Files changed (3)


   - Switch to stevedore_ for plugin management
   - mkvirtualenv_help should use ``$VIRTUALENVWRAPPER_PYTHON`` instead
     of calling ``virtualenv`` directly (:bbissue:`148`).
+  - Fix issue with lazy-loader code under zsh (:bbissue:`144`).
 .. _stevedore:


 test_dir=$(cd $(dirname $0) && pwd)
 source "$test_dir/"
 oneTimeSetUp() {
     rm -rf "$WORKON_HOME"
     mkdir -p "$WORKON_HOME"
+    [ ! -z "$ZSH_VERSION" ] && unsetopt shwordsplit
     source "$test_dir/../"
+    [ ! -z "$ZSH_VERSION" ] && setopt shwordsplit
 oneTimeTearDown() {
     assertTrue "$name not defined" "type $name"
 	assertTrue "$name does not load virtualenvwrapper" "typeset -f $name | grep 'virtualenvwrapper_load'"
+    if [ "$name" = "mkvirtualenv" ]
+    then
+        lookfor="rmvirtualenv"
+    else
+        lookfor="mkvirtualenv"
+    fi
+	assertFalse "$name includes reference to $lookfor: $(typeset -f $name)" "typeset -f $name | grep $lookfor"
 test_mkvirtualenv_defined_lazy() {

 # Set up "alias" functions based on the API definition.
 function virtualenvwrapper_setup_lazy_loader {
     typeset venvw_name
-	for venvw_name in $_VIRTUALENVWRAPPER_API
+	for venvw_name in $(echo ${_VIRTUALENVWRAPPER_API})
 		eval "
 function $venvw_name {
-	$venvw_name \"\$@\"
+	${venvw_name} \"\$@\"
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.