Skip to content

Define ExUnit tests alongside your private functions to test them.

License

Notifications You must be signed in to change notification settings

hauleth/ex_unit_embedded

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ExUnitEmbedded

Define tests within module to test private functions.

Installation

If available in Hex, the package can be installed by adding ex_unit_embedded to your list of dependencies in mix.exs:

def deps do
  [
    {:ex_unit_embedded, "~> 0.1.0"}
  ]
end

Documentation can be generated with ExDoc and published on HexDocs. Once published, the docs can be found at https://hexdocs.pm/exunit_embedded.

Usage

Simply use ExUnitEmbedded and define your tests (no describe available):

defmodule Foo do
  use ExUnitEmbedded

  defp foo, do: :ok

  test "foo/0 returns :ok" do
    assert :ok = foo()
  end
end

Then in your test module invoke unittest Foo:

defmodule FooTest do
  use ExUnit.Case
  import ExUnitEmbedded

  unittest Foo
end

License

Apache 2.0, see LICENSE.

About

Define ExUnit tests alongside your private functions to test them.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages