roundup-5-test.sh |
||
---|---|---|
This Will FailThat is the point. This is testing roundup(5). A few tests fail on purpose, because each is testing a specific success or failure condition. roundup(1) will flunk a plan executed with one or more failing tests. Therefore, this will fail. |
#!/usr/bin/env roundup
| |
A quick noteFor more information on how roundup views a test-plan, see roundup(5). |
| |
Let's get started |
| |
|
describe "roundup(5)"
| |
|
before() {
foo="bar"
}
| |
|
after() {
rm -f foo.txt
}
| |
Test basic success and failure conditions. These are intentionally silly
tests to keep their results deterministic. NOTE: the results of these, and all of the following tests are checked in roundup-1-test.sh |
it_passes() {
true
}
it_fails() {
false
}
| |
Check |
it_runs_before() {
test "$foo" "=" "bar"
}
| |
Start the |
it_runs_after_a_test_passes_part_1() {
touch foo.txt
test -f foo.txt
}
| |
Test the file dropped above is no longer on disk. If it doesn't exist, we
know |
it_runs_after_a_test_passes_part_2() {
test "!" -f foo.txt
}
| |
We want |
it_runs_after_if_a_test_fails_part_1() {
touch foo.txt
test -f foo.txt
false
}
| |
Start the |
it_runs_after_if_a_test_fails_part_2() {
test "!" -f foo.txt
}
| |
Roundup will ignore tests starting with |
xit_ignores_this() {
false
}
|
|
| ||