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"}
]
endDocumentation 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
endThen in your test module invoke unittest Foo:
defmodule FooTest do
use ExUnit.Case
import ExUnitEmbedded
unittest Foo
endLicense
Apache 2.0, see LICENSE.