Replies: 1 comment
-
|
I love testing... for me, coming from Ruby that has the gold standard rspec and the more niche (but excellent) cucumber, anything that any other language has to offer falls short of my expectations. I love approval-based testing. I am using it both for bash (approvals.bash) and for ruby (rspec_approvals), and it served me well for years. However, recently I decided that I need a more "unit testing oriented" test coverage, and started switching to bats. These are my first two repos that test with bats: ssi and alf. I think the problem in bash testing is not the framework, but the bash language itself. Stubbing and mocking in bash is awkward, which makes isolated unit testing harder to implement. All in all, I feel that bats is doing a good job at providing an easy to use CLI, easy to read output, and simple framework for defining test cases. I am also going to check ShellSpec which seems like a combination of gherkin and rspec for bash. Could be interesting. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I like BATS, it's battle tested and is around for more than a decade. I just don't like the amount of setup required to start testing (and more setup to get nice assertions). I mean, it's easy for me, but intimidating for newcomers, therefore hard for us "testing evangelists" to convince people to start writing tests.
From time to time I feel seduced by the simplicity that bashunit promises, but as soon as I try it I stumble into something really simple that doesn't give me the sense of safety I expect from a testing framework (example 1, example 2).
What about you guys? What are you using for bash testing?
Beta Was this translation helpful? Give feedback.
All reactions