Skip to content

Commit 388d33c

Browse files
committed
Run the cdproject test in a subshell
Watch for any command to fail for any reason and treat that as a failure. addresses issue #164
1 parent e0ed600 commit 388d33c

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

tests/test_project_cd.sh

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,17 @@ test_without_project () {
4040
}
4141

4242
test_space_in_path () {
43-
old_project_home="$PROJECT_HOME"
43+
(
44+
set -x
45+
set -e
4446
PROJECT_HOME="$PROJECT_HOME/with spaces"
4547
mkdir -p "$PROJECT_HOME"
4648
mkproject "myproject" >/dev/null 2>&1
47-
cd $TMPDIR
49+
cd "$WORKON_HOME"
4850
cdproject
49-
assertSame "$PROJECT_HOME/myproject" "$(pwd)"
50-
deactivate
51-
PROJECT_HOME="$old_project_home"
51+
[ "$PROJECT_HOME/myproject" == "$(pwd)" ]
52+
)
53+
assertTrue "Did not cd to project directory" $?
5254
}
5355

5456

0 commit comments

Comments
 (0)