diff example.sh @ 0:ed67ca9ff4c7

initial commit
author Serge A. Zaitsev <zaitsev.serge@gmail.com>
date Thu, 18 Dec 2014 23:49:30 +0200
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/example.sh	Thu Dec 18 23:49:30 2014 +0200
@@ -0,0 +1,27 @@
+# Include bricolage library
+. ./b.sh
+
+# Simple test
+mytest() {
+	ok 1 -eq 1
+	ok foo = foo
+	foo="Foo bar"
+	ok "$foo" = "Foo bar"
+}
+
+myspytest() {
+	spy date
+	date
+	ok "$(cat $T/spy.date.stdout)" != "foo"
+	echo foo > $T/spy.date
+	date
+	ok "$(tail -n 1 $T/spy.date.stdout)" = "foo"
+}
+
+# Run tests
+bricolage mytest
+bricolage myspytest
+
+# Remove test data
+rm -r "$T"
+