@@ -9,6 +9,7 @@ oneTimeSetUp() {
9
9
source " $test_dir /../virtualenvwrapper.sh"
10
10
mkvirtualenv " env1" > /dev/null 2>&1
11
11
mkvirtualenv " env2" > /dev/null 2>&1
12
+ mkvirtualenv " env with space" > /dev/null 2>&1
12
13
deactivate > /dev/null 2>&1
13
14
}
14
15
@@ -67,7 +68,7 @@ test_virtualenvwrapper_show_workon_options () {
67
68
mkdir " $WORKON_HOME /not_env"
68
69
(cd " $WORKON_HOME " ; ln -s env1 link_env)
69
70
envs=$( virtualenvwrapper_show_workon_options | tr ' \n' ' ' )
70
- assertSame " env1 env2 link_env " " $envs "
71
+ assertSame " env1 env2 link_env env with space " " $envs "
71
72
rmdir " $WORKON_HOME /not_env"
72
73
rm -f " $WORKON_HOME /link_env"
73
74
}
@@ -78,7 +79,7 @@ test_virtualenvwrapper_show_workon_options_grep_options () {
78
79
export GREP_OPTIONS=" --count"
79
80
envs=$( virtualenvwrapper_show_workon_options | tr ' \n' ' ' )
80
81
unset GREP_OPTIONS
81
- assertSame " env1 env2 link_env " " $envs "
82
+ assertSame " env1 env2 link_env env with space " " $envs "
82
83
rmdir " $WORKON_HOME /not_env"
83
84
rm -f " $WORKON_HOME /link_env"
84
85
}
@@ -94,7 +95,7 @@ test_virtualenvwrapper_show_workon_options_chpwd () {
94
95
}
95
96
mkdir " $WORKON_HOME /not_env"
96
97
envs=$( virtualenvwrapper_show_workon_options | tr ' \n' ' ' )
97
- assertSame " env1 env2 " " $envs "
98
+ assertSame " env1 env2 env with space " " $envs "
98
99
rmdir " $WORKON_HOME /not_env"
99
100
rm -f " $WORKON_HOME /link_env"
100
101
}
@@ -123,4 +124,19 @@ test_workon_dot () {
123
124
assertSame " env1" $( basename " $VIRTUAL_ENV " )
124
125
}
125
126
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
+
126
142
. " $test_dir /shunit2"
0 commit comments