Initial commit with IRC and bot example.

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
This commit is contained in:
2020-06-12 17:29:35 -04:00
commit 6340936895
20 changed files with 793 additions and 0 deletions

24
test/config_test.exs Normal file
View File

@@ -0,0 +1,24 @@
defmodule ConfigTest do
use ExUnit.Case
alias Omnibot.Config
test "config all_channels works correctly" do
cfg = %Config {
server: "test",
modules: [
{Test, channels: ["#foo", "#bar"]},
{Test, channels: ["#foo"]},
{Test, channels: ["#bar"]},
{Test, channels: ["#baz"]},
]
}
channels = Config.all_channels(cfg)
assert length(channels) == 3
assert Enum.any?(channels, fn channel -> channel == "#foo" end)
assert Enum.any?(channels, fn channel -> channel == "#bar" end)
assert Enum.any?(channels, fn channel -> channel == "#baz" end)
end
end