44
55test_dir=$( cd $( dirname $0 ) && pwd)
66
7- export WORKON_HOME=" $( echo ${TMPDIR:-/ tmp} /WORKON_HOME | sed ' s|//|/|g' ) "
7+ tmplocation=${TMPDIR:-/ tmp}
8+ export WORKON_HOME=" $( echo ${tmplocation} /WORKON_HOME | sed ' s|//|/|g' ) "
89
910export HOOK_VERBOSE_OPTION=-v
1011
@@ -28,15 +29,15 @@ test_tempfile () {
2829 filename=$( virtualenvwrapper_tempfile hook)
2930 assertTrue " Filename is empty" " [ ! -z \" $filename \" ]"
3031 rm -f $filename
31- comparable_tmpdir=$( echo $TMPDIR | sed ' s|/$||' )
32+ comparable_tmpdir=$( echo $tmplocation | sed ' s|/$||' )
3233 comparable_dirname=$( dirname $filename | sed ' s|/$||' )
33- assertSame " TMPDIR and path not the same for $filename " " $comparable_tmpdir " " $comparable_dirname "
34+ assertSame " Temporary directory \" $tmplocation \" and path not the same for $filename " " $comparable_tmpdir " " $comparable_dirname "
3435 assertTrue " virtualenvwrapper-hook not in filename." " echo $filename | grep virtualenvwrapper-hook"
3536}
3637
3738test_no_such_tmpdir () {
3839 old_tmpdir=" $TMPDIR "
39- TMPDIR=" $TMPDIR /does-not-exist"
40+ export TMPDIR=" $tmplocation /does-not-exist"
4041 virtualenvwrapper_run_hook " initialize" > /dev/null 2>&1
4142 RC=$?
4243 assertSame " Unexpected exit code $RC " " 1" " $RC "
@@ -45,7 +46,7 @@ test_no_such_tmpdir () {
4546
4647test_tmpdir_not_writable () {
4748 old_tmpdir=" $TMPDIR "
48- TMPDIR=" $TMPDIR /cannot-write"
49+ export TMPDIR=" $tmplocation /cannot-write"
4950 mkdir " $TMPDIR "
5051 chmod ugo-w " $TMPDIR "
5152 virtualenvwrapper_run_hook " initialize" > /dev/null 2>&1
0 commit comments