diff --git a/bin/git-check-assertions b/bin/git-check-assertions index b634c09..a30b992 100755 --- a/bin/git-check-assertions +++ b/bin/git-check-assertions @@ -30,6 +30,7 @@ run() { output="$("$@" 2>&1)" status=$? set -e + printf '%s\n' "$output" return 0 } assert_success() { diff --git a/test/git-check-assertions.bats b/test/git-check-assertions.bats index 6a152bd..7d13337 100755 --- a/test/git-check-assertions.bats +++ b/test/git-check-assertions.bats @@ -305,3 +305,13 @@ commit_with_assertion() { assert_output --partial "Expected output to contain: xyz" assert_output --partial "Actual output: hello" } + +@test "run should print command output" { + git checkout -b feature + commit_with_assertion $'run sh -c "echo -n hello; echo -n world"\nassert_success' + + run git-check-assertions + + assert_success + assert_output --partial "helloworld" +}