Skip to content

Pipe expectations #103

Description

@thiamsantos

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions