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

unable to test against verify_expectations/1 #57

Closed
stephenmoloney opened this issue Jan 30, 2018 · 1 comment
Closed

unable to test against verify_expectations/1 #57

stephenmoloney opened this issue Jan 30, 2018 · 1 comment

Comments

@stephenmoloney
Copy link

stephenmoloney commented Jan 30, 2018

Description:

  • unable to test against verify_expectations

Just wondering if there is some way to allow testing manually

When the test exits, the verify_expectations/1 function automatically calls on_exit..... and then I get the error No HTTP request arrived at Bypass and the test fails. The thing is that this is the behaviour I am expecting from one test in a suite of tests and I want to assert that this happened.

Is there some way to catch the error in the exit and assert in the test that this is the expected behaviour?

Or alternatively, is there some way that verify_expectations/1 being run in the on_exit function could be disabled manually and run inside the test instead?

Running the function manually is also not possible at the moment as the function raises an error Not available in ExUnit, as it's configured automatically.

@stephenmoloney
Copy link
Author

ok, i figured a way around this...
by calling ExUnit.Callbacks.on_exit({Bypass, bypass.pid}, fn ->

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

1 participant