Giter Club home page Giter Club logo

Comments (10)

aalepis avatar aalepis commented on August 27, 2024 1

I guess missed that part ☚ī¸
Thanks for explaining!

from mecks_unit.

archan937 avatar archan937 commented on August 27, 2024

Hey, there. I'll take a look at it this weekend

from mecks_unit.

aalepis avatar aalepis commented on August 27, 2024

Hey again, have given this any thought?

from mecks_unit.

archan937 avatar archan937 commented on August 27, 2024

I guess I have read your description incorrectly. The resulting behaviour is as expected. See also the README:

Please note that the defined mock modules only apply to the first mocked_test encountered. So they are isolated (despite of :meck having an unfortunate global effect) as MecksUnit takes care of it. Also, non-matching function heads within the mock module will result in invoking the original module function as well.

I had to change

assert Mocked.func2() === : returns_from_mocking

to

assert Mocked.func2() === :returns_from_module_a

to get the build succeeding (see: https://travis-ci.org/archan937/mecks_unit)

from mecks_unit.

aalepis avatar aalepis commented on August 27, 2024

Hey again @archan937 , can I propose as a feature for the library to give the option of choosing whether to apply the mocks to all the mocked_tests or just the first?

from mecks_unit.

archan937 avatar archan937 commented on August 27, 2024

Sure. I will add this later on this week. Keep an eye out! ;)

from mecks_unit.

aalepis avatar aalepis commented on August 27, 2024

That's great!
Thanks a lot 🙂

from mecks_unit.

archan937 avatar archan937 commented on August 27, 2024

Hey, @aalepis . It is a week later than promised but I have added the ability to "preserve" mock module definitions for the rest of the test case.

This has been release in MecksUnit v0.1.7 :)

For more information, please see https://github.com/archan937/mecks_unit#define-mock-module-for-entire-test-case and also 4219017

from mecks_unit.

aalepis avatar aalepis commented on August 27, 2024

Thank you very much @archan937, I really appreciate it!

from mecks_unit.

archan937 avatar archan937 commented on August 27, 2024

You're welcome, @aalepis. I hope it can help you further ;)

from mecks_unit.

Related Issues (5)

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.