Coder Social home page Coder Social logo

Comments (3)

ChrisJStone avatar ChrisJStone commented on July 30, 2024 1

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.

TheFern2 avatar TheFern2 commented on July 30, 2024

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.

TheFern2 avatar TheFern2 commented on July 30, 2024

@ChrisJStone thank you, that was the issue.

from bats-mock.

Related Issues (15)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.