-
Notifications
You must be signed in to change notification settings - Fork 517
running bats on a specific test file says file does not exist #104
Comments
Strange. I just checked out bats 0.4.0:
Do you use normal system bash? Can you try cloning latest bats from master and using that? Or |
Same issue when installed from
|
I'm using latest (non HEAD) bash from homebrew (4.3.33)
|
I seem to be running into the same issue, except that when I run
|
Here's the result of a run with
|
Notice the newline, in the error message. |
This part seems to be the crux of the error:
It looks like it somehow got the impression that the filename it needs to pass to If I had to guess I would say that it's trying to convert a relative path to an absolute path and doing it incorrectly. This is bolstered by the fact that a relative path does not work but an absolute path does work:
|
Looks like @Anvil hit the nail on the head; it seems related to
|
Try this patch : Anvil@80c8699 |
Fixes: sstephensonGH-104
unsetting CDPATH might interfer with user code, don't you think ? |
Yeah, I guess if someone is testing something that relies on CDPATH (probably rare), it could interfere. I'll take a look at your patch in a bit. |
FWIW, I just found this: https://bosker.wordpress.com/2012/02/12/bash-scripters-beware-of-the-cdpath/ |
A related issue in rbenv, another project from @sstephenson: Here's how it was fixed there ( |
|
but allow suppressing this behavior in case someone is testing something that relies on CDPATH. Fixes: sstephenson#104
Here's another PR that unsets |
As the OP, I can confirm that my issue was also caused by However, I think BATS should make every effort to still work even if |
@jasonkarns: I'm glad that helped! I agree with you that |
Works as advertised. |
While not recommended [1] `CDPATH` might be exported and would be used for e.g. `cd test` instead of using `./test`. E.g. Vim will make use of it (and therefore it needs to be exported, if you do not want to configure it twice). Fixes sstephenson#104. This supersedes sstephenson#119: there is no need to unset/change CDPATH globally. 1: https://bosker.wordpress.com/2012/02/12/bash-scripters-beware-of-the-cdpath/
See #159 for another approach at fixing this, without unsetting CDPATH globally. |
While not recommended [1] `CDPATH` might be exported and would be used for e.g. `cd test` instead of using `./test`. E.g. Vim will make use of it (and therefore it needs to be exported, if you do not want to configure it twice). Fixes sstephenson#104. This supersedes sstephenson#119: there is no need to unset/change CDPATH globally. 1: https://bosker.wordpress.com/2012/02/12/bash-scripters-beware-of-the-cdpath/
While not recommended [1], `CDPATH` might be exported and would be used for e.g. `cd test` instead of using `./test`. E.g. Vim will make use of it (and therefore it needs to be exported, if you do not want to configure it twice). Fixes sstephenson#104. This supersedes sstephenson#119: there is no need to unset/change CDPATH globally. 1: https://bosker.wordpress.com/2012/02/12/bash-scripters-beware-of-the-cdpath/
Per @jasonkarns's comment in sstephenson#104, it makes more sense to highlight Homebrew versus macOS, since Homebrew isn't the only method available on macOS.
README: Update installation for macOS, npm
Running bats against a whole directory works fine. But when I run bats against a particular test file, it says the file doesn't exist.
I'm running bats 0.4.0 (installed via homebrew) on OSX 10.9.5
The text was updated successfully, but these errors were encountered: