MishkaPay.ProviderCase (Mishka Pay v0.0.1)

Copy Markdown View Source

The contract tests every provider passes, ours and a project's own. One line runs them:

defmodule MyApp.Pay.AcmeTest do
  use MishkaPay.ProviderCase, provider: MyApp.Pay.Acme
end

It checks that the module implements every required callback of MishkaPay.Provider, that its id, label and capabilities are valid, that each capability has its operations, that a webhook nobody signed is refused, and that once its plugin starts, MishkaPay.Provider finds it by its id (or lists it, when offered?/0 keeps it out of the offered ones). Each stage of Mishka Pay adds the contract of its operations here, so a provider written today is checked against what tomorrow's calls expect.

It starts plugins, so the module is async: false; other ExUnit.Case options pass through. Write the provider's own tests below the use line.