Skip to content

Instantly share code, notes, and snippets.

@adolfont

adolfont/tdd.md Secret

Last active April 27, 2022 16:33
Show Gist options
  • Select an option

  • Save adolfont/e81d95e242ae13608969c9df3108b036 to your computer and use it in GitHub Desktop.

Select an option

Save adolfont/e81d95e242ae13608969c9df3108b036 to your computer and use it in GitHub Desktop.
TDD in Livebook with ExUnit

TDD in Livebook with ExUnit

Code

defmodule Adolfo do
  def name(), do: "adolfo"
end

Tests

ExUnit.start(auto_run: false)

defmodule AdolfoTest do
  use ExUnit.Case, async: false

  test "adolfo's name is adolfo" do
    assert Adolfo.name() == "adolfo"
  end
end

ExUnit.run()

Run Tests

To run the tests, click "Reevaluate" in the Elixir cell below "Tests".

Thanks

Thanks to David Bernheisel who pointed me to this blog post by Brooklyn Meyers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment