Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/bats-mock.bash
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ echo "\${call_num}" > "\${mock}.call_num"

echo "\${_USER:-\$(id -un)}" > "\${mock}.user.\${call_num}"

echo "\$@" > "\${mock}.args.\${call_num}"
printf "%s" "\$*" > "\${mock}.args.\${call_num}"

for var in \$(compgen -e); do
declare -p "\${var}"
Expand Down
8 changes: 8 additions & 0 deletions test/mock_get_call_args.bats
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,11 @@ load mock_test_suite
[[ "${status}" -eq 0 ]]
[[ "${output}" = 'six' ]]
}

@test 'mock_get_call_args with echo arguments work' {
"${mock}" -n -e "echo params"

run mock_get_call_args "${mock}"
[[ "${status}" -eq 0 ]]
[[ "${output}" = '-n -e echo params']]
}