-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #45 from smartcitiesdata/divo_case
Add Divo.Case
- Loading branch information
Showing
2 changed files
with
17 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
defmodule Divo.Case do | ||
@moduledoc """ | ||
Can be used in place of Divo to also include ExUnit.Case. | ||
Opts will still be passed to Divo as normal, and the async | ||
opt will be passed only to ExUnit.Case. | ||
""" | ||
|
||
defmacro __using__(opts \\ []) do | ||
{async, opts} = Keyword.pop(opts, :async, false) | ||
|
||
quote do | ||
use ExUnit.Case, async: unquote(async) | ||
use Divo, unquote(opts) | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters