@@ -9,6 +9,7 @@ oneTimeSetUp() {
99 source " $test_dir /../virtualenvwrapper.sh"
1010 mkvirtualenv " env1" > /dev/null 2>&1
1111 mkvirtualenv " env2" > /dev/null 2>&1
12+ mkvirtualenv " env with space" > /dev/null 2>&1
1213 deactivate > /dev/null 2>&1
1314}
1415
@@ -67,7 +68,7 @@ test_virtualenvwrapper_show_workon_options () {
6768 mkdir " $WORKON_HOME /not_env"
6869 (cd " $WORKON_HOME " ; ln -s env1 link_env)
6970 envs=$( virtualenvwrapper_show_workon_options | tr ' \n' ' ' )
70- assertSame " env1 env2 link_env " " $envs "
71+ assertSame " env1 env2 link_env env with space " " $envs "
7172 rmdir " $WORKON_HOME /not_env"
7273 rm -f " $WORKON_HOME /link_env"
7374}
@@ -78,7 +79,7 @@ test_virtualenvwrapper_show_workon_options_grep_options () {
7879 export GREP_OPTIONS=" --count"
7980 envs=$( virtualenvwrapper_show_workon_options | tr ' \n' ' ' )
8081 unset GREP_OPTIONS
81- assertSame " env1 env2 link_env " " $envs "
82+ assertSame " env1 env2 link_env env with space " " $envs "
8283 rmdir " $WORKON_HOME /not_env"
8384 rm -f " $WORKON_HOME /link_env"
8485}
@@ -94,7 +95,7 @@ test_virtualenvwrapper_show_workon_options_chpwd () {
9495 }
9596 mkdir " $WORKON_HOME /not_env"
9697 envs=$( virtualenvwrapper_show_workon_options | tr ' \n' ' ' )
97- assertSame " env1 env2 " " $envs "
98+ assertSame " env1 env2 env with space " " $envs "
9899 rmdir " $WORKON_HOME /not_env"
99100 rm -f " $WORKON_HOME /link_env"
100101}
@@ -123,4 +124,19 @@ test_workon_dot () {
123124 assertSame " env1" $( basename " $VIRTUAL_ENV " )
124125}
125126
127+ test_workon_dot_with_space () {
128+ cd $WORKON_HOME /" env with space"
129+ workon .
130+ assertTrue virtualenvwrapper_verify_active_environment
131+ env_name=$( basename " $VIRTUAL_ENV " )
132+ assertSame " env with space" " $env_name "
133+ }
134+
135+ test_workon_with_space () {
136+ workon " env with space"
137+ assertTrue virtualenvwrapper_verify_active_environment
138+ env_name=$( basename " $VIRTUAL_ENV " )
139+ assertSame " env with space" " $env_name "
140+ }
141+
126142. " $test_dir /shunit2"
0 commit comments