Open philtay opened 7 years ago
I wouldn't recommend doing so, since that flag would affect the operation of bats itself.
I suggest you find a way to write tests that are not dependent on pipefail
.
What about running it this way?
@test "foobar" {
bash -o pipefail -c "false | true"
}
it works for me
✗ foobar
(in test file test/pipefail.bats, line 8)
`bash -o pipefail -c "false | true"' failed
1 test, 1 failure
Yep, this is what I have resorted to. It's ugly. IMO bats
should support the Unofficial Bash Strict Mode by default.
Is there any way to set
-o pipefail
in a test function, test file or helper function?The test below should fail, but I can't find a way to do so: