Cyclium. Test. OutputCase
(Cyclium v0.1.5)
Copy Markdown
Test helpers for verifying output adapter contract compliance and
a FakeOutputAdapter for use in integration tests.
Usage
defmodule MyApp.Adapters.SlackTest do
use ExUnit.Case, async: true
use Cyclium.Test.OutputCase
test "delivers successfully" do
payload = %{channel: "#alerts", message: "test"}
ctx = %{episode_id: Ecto.UUID.generate()}
assert_valid_deliver(MyApp.Adapters.Slack, :slack, payload, ctx)
end
endFakeOutputAdapter
setup do
{:ok, _} = Cyclium.Test.FakeOutputAdapter.start_link()
:ok
end
# After strategy converge delivers outputs:
deliveries = Cyclium.Test.FakeOutputAdapter.deliveries()
Summary
Functions
Assert that an adapter is registered for the given type.
Assert that adapter.deliver/3 returns a valid response shape.