Skip to content

Commit 37084bd

Browse files
committed
temporary dir fixes for OS X El Capitan (10.11)
1 parent 9a98b70 commit 37084bd

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

tests/test_mkvirtualenv_associate.sh

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,10 @@ test_associate_relative_path() {
4141
ptrfile="$WORKON_HOME/$env/.project"
4242
mkvirtualenv -a "$project" "$env" >/dev/null 2>&1
4343
assertTrue ".project not found" "[ -f $ptrfile ]"
44-
assertEquals "$ptrfile contains wrong content" "$WORKON_HOME/$project" "$(cat $ptrfile)"
44+
assertEquals \
45+
"$ptrfile contains wrong content" \
46+
"$WORKON_HOME/$project" \
47+
"$(cat $ptrfile | sed 's|^/private||')"
4548
}
4649

4750
test_associate_not_a_directory() {
@@ -118,7 +121,13 @@ test_associate_relative_with_dots() {
118121
ptrfile="$WORKON_HOME/$env/.project"
119122
mkvirtualenv -a "$project" "$env" >/dev/null 2>&1
120123
assertTrue ".project not found" "[ -f $ptrfile ]"
121-
assertEquals "$ptrfile contains wrong content" "$WORKON_HOME/project$n" "$(cat $ptrfile)"
124+
# Sometimes OS X prepends /private on the front of the temporary
125+
# directory, but the directory is the same as without it, so strip
126+
# it if we see the value in the project file.
127+
assertEquals \
128+
"$ptrfile contains wrong content" \
129+
"$WORKON_HOME/project$n" \
130+
"$(cat $ptrfile | sed 's|^/private||')"
122131
}
123132

124133
. "$test_dir/shunit2"

0 commit comments

Comments
 (0)