1
0
mirror of https://github.com/sstephenson/bats.git synced 2024-09-29 12:38:26 +02:00

Add setup and teardown to the top.

Peter Aronoff 2013-10-24 16:04:04 -07:00
parent 805890a95b
commit 24847a0f8b

@ -1,4 +1,4 @@
In order to better understand what you can and can't do outside of `test` blocks, it's important to know how Bats processes test files. Below is a walkthrough by Sam:
In order to better understand what you can and can't do outside of `@test` blocks and `setup` or `teardown` functions, it's important to know how Bats processes test files. Below is a walkthrough by Sam:
1. First, each test file is preprocessed. This essentially amounts to replacing lines like `@test "first test" {` with `test_first_test() { bats_begin_test "first test";`, i.e. turning each `@test` block into a test function.