$ bats --version
Bats 1.2.0 --> latest version of bats
$ cat add.bats --> test file details
@test "addition using bc" {
result="$(echo 2+2 | bc)"
[ "$result" -eq 4 ]
}
@test "addition using dc" {
result="$(echo 2 2+p | dc)"
[ "$result" -eq 4 ]
}
$ bats add.bats --> Run test case
✓ addition using bc
✓ addition using dc
2 tests, 0 failures
$ bats -c add.bats --> count number of test cases
2
$ bats --formatter junit -T add.bats --> FAILURE/ERROR JUNIT XML output
Error: Bad command line option '--formatter'
-- bats helper menu is displayed
OSType: MacOS Mojave version: 10.14.6 (18G5033)
$ bats --version Bats 1.2.0 --> latest version of bats $ cat add.bats --> test file details @test "addition using bc" { result="$(echo 2+2 | bc)" [ "$result" -eq 4 ] } @test "addition using dc" { result="$(echo 2 2+p | dc)" [ "$result" -eq 4 ] } $ bats add.bats --> Run test case ✓ addition using bc ✓ addition using dc
2 tests, 0 failures
$ bats -c add.bats --> count number of test cases 2 $ bats --formatter junit -T add.bats --> FAILURE/ERROR JUNIT XML output Error: Bad command line option '--formatter' -- bats helper menu is displayed