Giter Site home page Giter Site logo

Comments (6)

alco avatar alco commented on May 20, 2024

Hi Chris,

What is an equivalent way of checking that the expectation function has been called when using espec?

from bypass.

chrisjowen avatar chrisjowen commented on May 20, 2024

Just looking and it doesn't seem like there is an equivalent of the on_exit callback. Honestly, I just pulled this out on a fork because I didn't care about calls that shouldn't have been made because I was confident there were none and the ones I expected to be called would have failed my tests if not anyway because of the behaviour I added to the mock.

I understand the value of this though, but could it not be explicitly called i.e. Bypass.ensure_all_calls/1 or whatever, instead of relying on callback hooks?

from bypass.

MSch avatar MSch commented on May 20, 2024

Hi Chris,

When using Bypass with ExUnit we definitely want to keep the default behavior, but I am open to accepting PRs that make Bypass support espec out of the box.

from bypass.

tompave avatar tompave commented on May 20, 2024

Hi, I would love to see support for ESpec added to this library.

I've found out about Bypass today and I think it's an incredibly helpful too. It does exactly what I need, and it was a bad surprise to see it crash because it's hard-wired to ExUnit.

I think that for the moment I'll just disable that functionality in a fork, like @chrisjowen has done. I only need a simple stubbed HTTP server on localhost and don't really need expectations on the calls.

Maybe it would be nice to introduce an allow or stub API that does the same job of expect, but without setting expectations, so that users can choose.

What is an equivalent way of checking that the expectation function has been called when using espec?

I'm not sure, but perhaps @antonmi, ESpec's author, may be able to give us some pointers.

from bypass.

tompave avatar tompave commented on May 20, 2024

Apparently there was another issue (#9) on the same topic. That contains some more info on a possible implementation.

Is there any chance or interest in seeing this implemented? What approach should a pull request adopt? Using different adapters probably makes sense.

from bypass.

MSch avatar MSch commented on May 20, 2024

Thanks again @tompave - I just released 0.8.0 of bypass with your ESpec support included ❤️

from bypass.

Related Issues (20)

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.