-
Notifications
You must be signed in to change notification settings - Fork 40
Open
Description
If the arguments string includes an asterisk then the bats-mock stub appears to fail to recognise the call.
Reduced test case:
#!/usr/bin/env bats
load '../vendor/bats-mock/stub'
teardown() {
unstub aws
}
# fails
@test "test with asterisk" {
stub aws \
"ec2 describe-snapshots --query Snapshots[*].{Time:StartTime} : echo 'foo'"
run aws ec2 describe-snapshots --query Snapshots[*].{Time:StartTime}
[ "$output" = "foo" ]
}
# passes
@test "test without asterisk" {
stub aws \
"ec2 describe-snapshots --query Snapshots[].{Time:StartTime} : echo 'foo'"
run aws ec2 describe-snapshots --query Snapshots[].{Time:StartTime}
[ "$output" = "foo" ]
}
Output:
$ vendor/bats/bin/bats test/test_case.bats
✗ test with asterisk
(in test file test/test_case.bats, line 14)
`[ "$output" = "foo" ]' failed
✓ test without asterisk
2 tests, 1 failure
Metadata
Metadata
Assignees
Labels
No labels