bats-mock

Mocking/stubbing library for BATS (Bash Automated Testing System)


Keywords
bash, bats, mock, stub, shell, test, unit
License
MIT
Install
npm install bats-mock@1.0.1

Documentation

bats-mock

Mocking/stubbing library for BATS (Bash Automated Testing System)

Installation

Recommended installation is via git submodule. Assuming your project's bats tests are in test:

git submodule add https://github.com/jasonkarns/bats-mock test/helpers/mocks
git commit -am 'added bats-mock module'

then in test/test_helper.bash:

load helpers/mocks/stub

(Optionally configure sparse-checkout if you're concerned with all the non-essential files being in your repo)

Also available as an npm module if you're into that sort of thing.

npm install --save-dev bats-mock

then in test/test_helper.bash:

load ../node_modules/bats-mock/stub

Credits

Extracted from the ruby-build test suite. Many thanks to its author and contributors: Sam Stephenson and Mislav Marohnić.