Skip to content

Ability to put output on stderr #22

@jack1902

Description

@jack1902

Currently, it is possible to use mock_set_output to put output on stdout which is done by the below lines within the mock.

if [[ -e "\${mock}.output.\${call_num}" ]]; then
cat "\${mock}.output.\${call_num}"
else
cat "\${mock}.output"
fi

This is extremely useful for cases whereby you want to control output to test specific cases of output on stdout, but it means scripts that check what is on stderr are left in a situation that you need to do something like 2>&1 to enable mock_set_output to work in its current form.

It would be really useful to be able to do something like mock_set_stderr "${mock_YOURMOCK}" "message" <optional_call>, which would effectively enable a user to specify both stdout and stderr for specific calls like you already can for mock_set_output

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions