Skip to main content

ExUnit

Basic Setup

Solution

defmodule Kata do
  def add(a, b) do
    a + b
  end
end
defmodule Kata do
  def add(a, b) do
    a + b
  end
end

Tests

defmodule TestSolution do
  use ExUnit.Case
  import Kata, only: [add: 2]

  test "adds two numbers" do
    assert add(1, 2) == 3
  end
end
defmodule TestSolution do
  use ExUnit.Case
  import Kata, only: [add: 2]

  test "adds two numbers" do
    assert add(1, 2) == 3
  end
end