sstephenson / bats

Bash Automated Testing System
MIT License
7.13k stars 517 forks source link

Unset CDPATH to prevent weird problems #119

Closed msabramo closed 8 years ago

msabramo commented 9 years ago

but allow suppressing this behavior in case someone is testing something that relies on CDPATH.

Fixes: https://github.com/sstephenson/bats/issues/104

[marca@marca-mac2 ansible-heroku-output]$ ~/dev/git-repos/bats/bin/bats test/bats/echo_ascii.bats
Unsetting CDPATH to prevent problems like https://github.com/sstephenson/bats/issues/104 ...
To suppress this behavior, set BATS_KEEP_CDPATH
You may want to consider not exporting CDPATH
 ✓ Test playbook with ASCII

1 test, 0 failures

[marca@marca-mac2 ansible-heroku-output]$ BATS_KEEP_CDPATH=1 ~/dev/git-repos/bats/bin/bats test/bats/echo_ascii.bats
bats: /Users/marca/dev/git-repos/ansible-heroku-output/test/bats
/Users/marca/dev/git-repos/ansible-heroku-output/test/bats/echo_ascii.bats does not exist
msabramo commented 8 years ago

I'm closing this, because I just saw #159 from @blueyed and that seems like a better approach. I hope that gets merged.