#!/usr/bin/env bats load test_helper @test "testing" { result="$(echo 2+2 | bc)" [ "$result" -eq 4 ] } @test "is successfull" { run echo 'hello' assert_success $'hello' } @test "produces an error" { run rm blah if [[ "$OSTYPE" == "darwin"* ]]; then assert_failure $'rm: blah: No such file or directory' elif [[ "$OSTYPE" == "linux-gnu"* ]]; then assert_failure $'rm: cannot remove \'blah\': No such file or directory' elif [[ "$OSTYPE" == "linux-musl"* ]]; then assert_failure $'rm: can\'t remove \'blah\': No such file or directory' else assert_failure fi }