Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove dependency to ExUnit #37

Closed
chrisjowen opened this issue Mar 14, 2017 · 6 comments
Closed

remove dependency to ExUnit #37

chrisjowen opened this issue Mar 14, 2017 · 6 comments

Comments

@chrisjowen
Copy link

Hey,

First off thanks for the library its useful, good work. I was wondering if you could remove the dependency on ExUnit, I and several others use https://github.com/antonmi/espec as my testing framework and the ExUnit.Callbacks.on_exit check you do obviously blows up for me as I have no process running for ExUnit.

I understand the value this callback and see your verifying calls here and even if the dependency remained it would be nice if this was an explicit call and not wired into the ExUnits on_exit calback

@alco
Copy link
Contributor

alco commented May 10, 2017

Hi Chris,

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

@chrisjowen
Copy link
Author

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?

@MSch
Copy link
Member

MSch commented Jun 21, 2017

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.

@tompave
Copy link
Contributor

tompave commented Jul 9, 2017

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.

@tompave
Copy link
Contributor

tompave commented Jul 9, 2017

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.

@MSch
Copy link
Member

MSch commented Jul 19, 2017

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

@MSch MSch closed this as completed Jul 19, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants