Skip to content

Commit e971ae5

Browse files
committed
why
1 parent 1784f23 commit e971ae5

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,27 @@ T_failMultiple() {
8787
}
8888
```
8989

90+
## Why not Bats or shunit2?
91+
92+
Good question. I've used both and enjoyed using them until I got tired of what I didn't like. With Bats these issues bothered me:
93+
94+
* Useless syntactic sugar making test files require Bats instead of just Bash to process, making Bats more complicated and harder to debug.
95+
* The Bats-specific helpers that could be replaced with idiomatic Bash-isms.
96+
* Using `set -e` means you have to use the `run` helper for nearly everythng in larger tests.
97+
* The multi-file, multi-directory install.
98+
99+
On the plus side, it did take a might more lightweight approach to unit testing. But the issues made me turn to shunit2. It addressed all the above issue, but then I ran into:
100+
101+
* For what it did and what I used, it was not worth the 1000 lines of overly portable, overly clever shell script.
102+
* I had to modify it anyway, and ended up putting it in the source of every project that used it.
103+
104+
Basht might not be for everybody, but I wrote it and use it because:
105+
106+
* It's written in and made for pure Bash.
107+
* It's distributed as a single file binary.
108+
* It's only about 50 lines and does everything I need.
109+
* It's inspired in design and appearance by Go's testing.
110+
90111
## License
91112

92113
BSD

0 commit comments

Comments
 (0)