Vendoring bats libraries.

Signed-off-by: Chad Metcalf <chad@docker.com>
This commit is contained in:
Chad Metcalf
2020-08-08 12:46:22 -07:00
committed by Chad Metcalf
parent 5185cedf4e
commit 6565a1f745
48 changed files with 4646 additions and 0 deletions

View File

@@ -0,0 +1,40 @@
#!/usr/bin/env bats
load test_helper
@test "assert_success(): returns 0 if \`\$status' is 0" {
run true
run assert_success
assert_test_pass
}
@test "assert_success(): returns 1 and displays details if \`\$status' is not 0" {
run bash -c 'echo "a"
exit 1'
run assert_success
assert_test_fail <<'ERR_MSG'
-- command failed --
status : 1
output : a
--
ERR_MSG
}
@test "assert_success(): displays \`\$output' in multi-line format if it is longer than one line" {
run bash -c 'printf "a 0\na 1"
exit 1'
run assert_success
assert_test_fail <<'ERR_MSG'
-- command failed --
status : 1
output (2 lines):
a 0
a 1
--
ERR_MSG
}