You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+21Lines changed: 21 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -87,6 +87,27 @@ T_failMultiple() {
87
87
}
88
88
```
89
89
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.
0 commit comments