vendredi 22 juillet 2016

Test method delegation in Elixir

I've got two modules:

defmodule Base.ModuleOne do
  def do_stuff(opts) do
    "some stuff"
  end
end

defmodule Base.ModuleTwo do
  defdelegate do_stuff(opts), to: Base.ModuleOne
end

What is the proper way of testing delegation without copy-pasting tests for Base.ModuleOne.do_stuff/1 function under different namespace?

Aucun commentaire:

Enregistrer un commentaire