-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce "use Gettext.Backend" (#390)
Co-authored-by: José Valim <jose.valim@dashbit.co>
- Loading branch information
1 parent
e6e9fe8
commit c602ea9
Showing
3 changed files
with
100 additions
and
48 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
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
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,18 @@ | ||
defmodule Gettext.BackendTest do | ||
use ExUnit.Case, async: true | ||
|
||
describe "use Gettext.Backend" do | ||
test "creates a backend" do | ||
body = | ||
quote do | ||
use Gettext.Backend, | ||
otp_app: :test_application | ||
end | ||
|
||
{:module, mod, _bytecode, :ok} = Module.create(TestBackend, body, __ENV__) | ||
|
||
assert mod.__gettext__(:otp_app) == :test_application | ||
assert mod.__info__(:attributes)[:behaviour] == [Gettext.Backend] | ||
end | ||
end | ||
end |