Closed johngassman-ws closed 4 years ago
_output_contains is grep'ing for all following args ("$*") which breaks if you specify an optional message
Example: Given a method that just: echo "Gimme some foo"
echo "Gimme some foo"
Happy path: _assert _output_contains "foo"
_assert _output_contains "foo"
Unhappy path: _assert _output_contains "foo" "there is foo"
_assert _output_contains "foo" "there is foo"
Changing the _output_contains function to: grep -Fqi "$1" <<< "$_output" appears to fix the issue.
grep -Fqi "$1" <<< "$_output"
Thanks for the bug report! Should be a straightforward fix like you pointed out. Will get it in ASAP.
_output_contains is grep'ing for all following args ("$*") which breaks if you specify an optional message
Example: Given a method that just:
echo "Gimme some foo"
Happy path:
_assert _output_contains "foo"
Unhappy path:
_assert _output_contains "foo" "there is foo"
Changing the _output_contains function to:
grep -Fqi "$1" <<< "$_output"
appears to fix the issue.