Skip to content

Commit

Permalink
#45: add matching on any request
Browse files Browse the repository at this point in the history
  • Loading branch information
adamw committed Nov 14, 2017
1 parent 3e80847 commit 669c758
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,14 @@ class SttpBackendStub[R[_], S] private (
def whenRequestMatches(p: Request[_, _] => Boolean): WhenRequest =
new WhenRequest(p)

/**
* Specify how the stub backend should respond to any request (catch-all).
*
* Note that the stubs are immutable, and each new
* specification that is added yields a new stub instance.
*/
def whenAnyRequest: WhenRequest = whenRequestMatches(_ => true)

/**
* Specify how the stub backend should respond to requests using the
* given partial function.
Expand Down

0 comments on commit 669c758

Please sign in to comment.