lib/matchers/value.ex

defmodule Matcher.Value do
  defstruct [:expected]

  defimpl Matcher.Protocol do
    def match(%{expected: expected}, actual) do
      if expected == actual do
        {:ok, nil}
      else
        {:error,
         %{
           module: Matcher.Protocol,
           message: "mismatch: #{inspect(expected)} != #{inspect(actual)}"
         }}
      end
    end
  end
end