Overridable Attesto.CodeStore callback delegates for test doubles.
A host can wrap a real store and override only the callbacks a test needs
to observe or fault. The :to option selects the delegate target and
defaults to Attesto.CodeStore.ETS; the target must be started separately.
defmodule Host.ObservedCodeStore do
use Attesto.Test.CodeStoreDelegates, to: Attesto.CodeStore.ETS
def claim(hash) do
send(self(), {:claim, hash})
super(hash)
end
endThe generated module implements every Attesto.CodeStore callback and
marks each one overridable. This helper has no ExUnit dependency.
Summary
Functions
Define overridable code-store callbacks delegating to :to (ETS by default).