Comments (3)
How did you install bats-mock? looking in the mock folder under test your missing binstub. This is more then likely the cause of your issue as I recreated your project setup at my-bats-mock-test and was able to get a passing test. Since I installed both bats and bats-mock as submodules, you would need to use git clone --recursive to automatically download bats and bats-mock if you wanted to test on your local machine.
from bats-mock.
I took a look at some of the "used by" projects, and tried to setup my structure like flash, although that repo sources from node modules, I have bats installed with brew.
Anyways if someone could please look at this project and tell me what's wrong, it does run my src/project.sh get_signal_level function but the stub isn't being injected for some reason and I get the following results.
- src/ holds the project code
- test/ holds bats tests and test_helper.bash with stub functions
https://github.com/TheFern2/my-bats-mock-test
~/g/t/bats-test ❯❯❯ bats test/first_test.bats ✘ 1
first_test.bats
✗ cell_mgmt get_signal_level tests
(in test file test/first_test.bats, line 19)
`[ "$result" == 'nosignal' ]' failed
Stubbing cell_mgmt
./src/project.sh: line 7: cell_mgmt: command not found
1 test, 1 failure
from bats-mock.
@ChrisJStone thank you, that was the issue.
from bats-mock.
Related Issues (15)
- documentation HOT 6
- tests
- cleanup function HOT 6
- spy-like behavior HOT 1
- Stub fails to recognise call when arguments contain an asterisk character HOT 1
- Support for calling the same mocked call - argument multiple times HOT 2
- Question: Advantage of bats-mock over stub.sh? HOT 2
- Stubbing w/ more than 2 threads doesn't work
- Print missing invocations on failure
- Update peer dependencies to support bats 1.1.0
- Migrate to bats-core org? HOT 1
- `read` fails to stub, halts test runner HOT 2
- `stub` not concurrent-safe with parallel test execution (with `--jobs`) HOT 1
- Feature: add stub_repeated from ruby-build
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bats-mock.