-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
defmodule BoomNotifier.BoomNotifierTest do | ||
use BoomNotifier.Case | ||
|
||
@receive_timeout 100 | ||
Check warning on line 4 in test/unit/boom_notifier_test.exs GitHub Actions / Build and test (1.11, 21)
Check warning on line 4 in test/unit/boom_notifier_test.exs GitHub Actions / Build and test (1.10, 22)
Check warning on line 4 in test/unit/boom_notifier_test.exs GitHub Actions / Build and test (1.12, 22)
Check warning on line 4 in test/unit/boom_notifier_test.exs GitHub Actions / Build and test (1.10, 21)
Check warning on line 4 in test/unit/boom_notifier_test.exs GitHub Actions / Build and test (1.12, 24)
Check warning on line 4 in test/unit/boom_notifier_test.exs GitHub Actions / Build and test (1.11, 22)
Check warning on line 4 in test/unit/boom_notifier_test.exs GitHub Actions / Build and test (1.11, 24)
Check warning on line 4 in test/unit/boom_notifier_test.exs GitHub Actions / Build and test (1.12, 24)
Check warning on line 4 in test/unit/boom_notifier_test.exs GitHub Actions / Build and test (1.10, 23)
Check warning on line 4 in test/unit/boom_notifier_test.exs GitHub Actions / Build and test (1.12, 23)
Check warning on line 4 in test/unit/boom_notifier_test.exs GitHub Actions / Build and test (1.11, 23)
Check warning on line 4 in test/unit/boom_notifier_test.exs GitHub Actions / Build and test (1.13, 24)
Check warning on line 4 in test/unit/boom_notifier_test.exs GitHub Actions / Build and test (1.14, 25)
Check warning on line 4 in test/unit/boom_notifier_test.exs GitHub Actions / Build and test (1.13, 22)
Check warning on line 4 in test/unit/boom_notifier_test.exs GitHub Actions / Build and test (1.14, 24)
Check warning on line 4 in test/unit/boom_notifier_test.exs GitHub Actions / Build and test (1.14, 23)
|
||
|
||
defmodule FakeNotifier do | ||
def notify(_, _), do: nil | ||
end | ||
|
||
describe "to_config/1" do | ||
defmodule ToConfigEndpoint do | ||
def call(conn, _opts), do: conn | ||
|
||
use BoomNotifier, | ||
notifier: FakeNotifier | ||
end | ||
|
||
test "accepts a module name" do | ||
assert BoomNotifier.to_config(ToConfigEndpoint) == ToConfigEndpoint.boom_config() | ||
end | ||
|
||
test "it calls boom_notifier when a module is specified" do | ||
assert_raise(UndefinedFunctionError, fn -> | ||
BoomNotifier.to_config(Kernel) | ||
end) | ||
end | ||
|
||
test "accepts a keyword list" do | ||
assert BoomNotifier.to_config(notifier: FakeNotifier) == ToConfigEndpoint.boom_config() | ||
end | ||
end | ||
end |