Presented at Velocity Santa Clara 2016, June 22
Relevant links:
https://github.com/sstephenson/bats
https://github.com/concourse/git-resource/tree/master/test
https://github.com/rbenv/ruby-build/tree/master/test
13. @cjcjameson13
You’re writing an installer file
Be documentation
Make integration easy
(esp. across distros)
So your unit tests should help:
14. @cjcjameson14
You’re touching this code for the first and only time
Drive modular designMake change easy
So your unit tests should help:
Be documentation
15. @cjcjameson15
You’re treating the filesystem as a first-class object
Drive modular designFind problems early
So your unit tests should help:
16. @cjcjameson16
You’re writing a shared `common.bash` library
Be documentationMake integration easy
So your unit tests should help:
23. @cjcjameson23
Inside the BATS `run` command
https://github.com/sstephenson/bats
- Exit codes are swallowed
- `stdout` and `stderr` are swallowed
- Start by `source`ing in the file under test … so the file runs