Mercurial Hosting > bricolage
changeset 1:bce8021ad094
added README
author | Serge A. Zaitsev <zaitsev.serge@gmail.com> |
---|---|
date | Fri, 19 Dec 2014 00:01:19 +0200 |
parents | ed67ca9ff4c7 |
children | 078a17d15fa5 |
files | README.md |
diffstat | 1 files changed, 44 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
diff -r ed67ca9ff4c7 -r bce8021ad094 README.md --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/README.md Fri Dec 19 00:01:19 2014 +0200 @@ -0,0 +1,44 @@ +# Bricolage + +Bricolage is an ultimately minimal testing library for UNIX Shell. It follows the idea of klud.js and gambiarra.lua + +## Usage + + # include b.sh + . b.sh + + # optionally define pass/fail handlers + pass() { + echo "PASS $*" + } + + fail() { + echo "FAIL $*" + } + + # write your test functions + mytest() { + # inside use test assertions + ok 1 -eq 1 + ok $FOO = "somevalue" + # mock/spy some commands + spy ls + # give fake command output + echo "file.txt" > $T/spy.ls + # use fake ls + ls /some/dir + # ensure that argument was passed correctly + ok $(cat $T/spy.ls.args) = "/some/dir" + # ensure that command return expected output + ok $(cat $T/spy.ls.stdout) = "file.txt" + } + + # run your tests + bricolage mytest + + # cleanup + rm -r $T + +## License + +Distributed under MIT license