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

Pipe expectations #103

Open
thiamsantos opened this issue Aug 22, 2020 · 0 comments · May be fixed by #105
Open

Pipe expectations #103

thiamsantos opened this issue Aug 22, 2020 · 0 comments · May be fixed by #105

Comments

@thiamsantos
Copy link
Contributor

Motivation

Would be nice to be able to pipe expectation calls, passing the bypass instance to next expectation.

bypass
|> Bypass.expect("POST", "/auth", fn conn ->
  # response ...
end)
|> Bypass.expect("POST", "/resource", fn conn ->
  # assert authenticated
  # response
end)

Similar to what mox does:

MyMock
|> expect(:add, fn x, y -> x + y end)
|> expect(:add, fn x, y -> x * y end)

Proposed solution

Return the bypass instance back in all expectation functions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants