Mocking/stubbing library for BATS (Bash Automated Testing System)
Recommended installation is via git submodule. Assuming your project's bats
tests are in
git submodule add https://github.com/jasonkarns/bats-mock test/helpers/mocksgit commit -am 'added bats-mock module'
That is all that's necessary to get the stub helpers into your project. However, as a submodule, it pulls in this entire repo. If you'd like only the minimum necessary files, you'll need to configure the submodule for sparse-checkout.
Enable sparse-checkout from the submodule directory:
cd test/helpers/mocksgit config core.sparsecheckout true
Then configure explictly list the files you wish to have checked out. From the root of your project:
echo stub.bash >> .git/modules/test/helpers/mocks/info/sparse-checkoutecho binstub >> .git/modules/test/helpers/mocks/info/sparse-checkout