ReqClient.Adapter.Stub (req_client v0.1.17)

Copy Markdown View Source

Req stub adapter

eg. Rc.get! :x, stub: :ok, debug: true

Avoid builtin run_plug step, because it depends on plug dependency, mainly used for testing!

Fake adapter:

iex> defmodule MyApp.Fake do ...> use ReqClient.Adapter.Stub, adapter: fake ...> def run(request) ...> {request, Req.Response.new(status: 200, body: "it works!")} ...> end ...> end iex> req = Req.new(adapter: MyApp.Fake) iex> Req.get!(req).body "it works!"

Summary

Functions

kind_name()