Skip to content

Commit

Permalink
Merge branch 'before_after'
Browse files Browse the repository at this point in the history
  • Loading branch information
Pierre Prinetti committed Jul 10, 2017
2 parents 9ecddc3 + 1be005c commit 0991f89
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,28 @@ That would produce the following output:

3 tests completed.

### Setup and Teardown

In `some_test.sh`:

#!/usr/bin/env bash

before() {
export CAKE_FILLER='chocolate'
}

test_app_configuration_through_env {
$response=$(curl -s http://my.website.com/cake-filler)
echo "$response" | grep -q "chocolate"
}

after() {
unset CAKE_FILLER
}

`before` and `after` functions are executed before and after executing
the tests from the current file.

## License

bash-test is released under the [MIT License][2].
Expand Down

0 comments on commit 0991f89

Please sign in to comment.