https://github.com/hauleth/ex_unit_embedded
Define ExUnit tests alongside your private functions to test them.
https://github.com/hauleth/ex_unit_embedded
elixir exunit testing
Last synced: 8 months ago
JSON representation
Define ExUnit tests alongside your private functions to test them.
- Host: GitHub
- URL: https://github.com/hauleth/ex_unit_embedded
- Owner: hauleth
- License: apache-2.0
- Created: 2019-02-06T17:59:56.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-02-06T19:32:03.000Z (over 7 years ago)
- Last Synced: 2025-08-01T23:42:05.330Z (11 months ago)
- Topics: elixir, exunit, testing
- Language: Elixir
- Homepage:
- Size: 10.7 KB
- Stars: 7
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ExUnitEmbedded
Define tests within module to test private functions.
## Installation
If [available in Hex](https://hex.pm/docs/publish), the package can be installed
by adding `ex_unit_embedded` to your list of dependencies in `mix.exs`:
```elixir
def deps do
[
{:ex_unit_embedded, "~> 0.1.0"}
]
end
```
Documentation can be generated with [ExDoc](https://github.com/elixir-lang/ex_doc)
and published on [HexDocs](https://hexdocs.pm). Once published, the docs can
be found at [https://hexdocs.pm/exunit_embedded](https://hexdocs.pm/ex_unit_embedded).
## Usage
Simply use `ExUnitEmbedded` and define your tests (no `describe` available):
```elixir
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`:
```elixir
defmodule FooTest do
use ExUnit.Case
import ExUnitEmbedded
unittest Foo
end
```
## License
Apache 2.0, see [LICENSE](LICENSE).