-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Resolve programs used in stub() before modifying PATH #13
base: main
Are you sure you want to change the base?
Conversation
…k-support-of-arguments-wiht-whitespaces to master * commit '60758e0d3059c9ba04c8b29e347012b27bcb27e6': Fix mockers handling of arguments with white spaces
Revert "Merge pull request jasonkarns#1 in BB/bats-mocks from feature/fix-mock-support-of-arguments-wiht-whitespaces to master" This reverts commit f2a1350, reversing changes made to 53733e7.
mkdir -p "${BATS_MOCK_BINDIR}" | ||
ln -sf "${BASH_SOURCE[0]%stub.bash}binstub" "${BATS_MOCK_BINDIR}/${program}" | ||
"$MKDIR" -p "${BATS_MOCK_BINDIR}" | ||
"$LN" -sf "${BASH_SOURCE[0]%stub.bash}binstub" "${BATS_MOCK_BINDIR}/${program}" | ||
|
||
touch "${BATS_MOCK_TMPDIR}/${program}-stub-plan" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what about touch
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thought the same. Would be great if this gets in. Pointed out a few minor issues and would suggest to rebase to master removing the merge and do-revert commits
@@ -58,7 +58,12 @@ while IFS= read -r line; do | |||
|
|||
case "$argument" in | |||
"$pattern" ) ;; | |||
* ) result=1 ;; | |||
* ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks similar to my PR #20. Can you test that and if that suits you remove this from this PR
@@ -1,6 +1,9 @@ | |||
BATS_MOCK_TMPDIR="${BATS_TMPDIR}" | |||
BATS_MOCK_BINDIR="${BATS_MOCK_TMPDIR}/bin" | |||
|
|||
MKDIR=$(which mkdir) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Possibly prefix commands with BATS_MOCK
to avoid name clashes with user variables.
ln
andmkdir
can't be stubbed because they are used instub.bash
after modifying PATH. So resolve them while PATH is still intact and use the absolute path thereafter.