-
-
Notifications
You must be signed in to change notification settings - Fork 41
Closed
Copy link
Labels
bugSomething isn't workingSomething isn't working
Description
| Q | A |
|---|---|
| OS | macOS and Linux |
| Shell & version | bash 5.3.3 (macOS) and bash 5.2.32 (Linux) |
| bashunit version | 0.24.0 (both) |
Summary
assert_have_been_called_with will produce a false negative when the spied command's args include a literal pipe
Current behavior
After creating a spy for a command and then calling that command with arguments that contain a literal pipe (|) character, assert_have_been_called_with will not compare the expected value against the correct actual value, and the assertion will fail erroneously.
How to reproduce
This test currently fails:
function test_grep_with_or_pattern_arg() {
spy grep
grep -E 'foo|bar'
assert_have_been_called_with grep '-E foo|bar'
}Output:
✗ Failed: Grep with or pattern arg
Expected '-E foo|bar'
but got '-E foo'
Expected behavior
assert_have_been_called_with grep '-E foo|bar' should pass
Chemaclass
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working
Type
Projects
Status
Done