diff options
author | Paul Schoenfelder <paulschoenfelder@gmail.com> | 2013-12-06 16:09:50 -0600 |
---|---|---|
committer | Paul Schoenfelder <paulschoenfelder@gmail.com> | 2013-12-06 16:09:50 -0600 |
commit | e90d6e995016e39ebba2c6ba603b892ec074efd1 (patch) | |
tree | 21650e48561f108fb052cc2ede5029322b09b3f6 /test/utils_test.exs | |
parent | Fix all of the compilation issues. Need tests (diff) |
Start adding utils tests. Fix some utils bugs
Diffstat (limited to 'test/utils_test.exs')
-rw-r--r-- | test/utils_test.exs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/test/utils_test.exs b/test/utils_test.exs new file mode 100644 index 0000000..3086f7d --- /dev/null +++ b/test/utils_test.exs @@ -0,0 +1,17 @@ +defmodule ExIrc.UtilsTest do + use ExUnit.Case + alias ExIrc.Utils, as: Utils + alias ExIrc.Client.IrcMessage, as: IrcMessage + alias ExIrc.Client.ClientState, as: ClientState + + test "Given a local date/time as a tuple, can retrieve get the CTCP formatted time" do + local_time = {{2013,12,6},{14,5,00}} + assert Utils.ctcp_time(local_time) == 'Fri Dec 06 14:05:00 2013' + end + + test "Can parse an IRC message" do + message = ':irc.example.org 005 nick PREFIX=(ov)@+ CHANTYPES=#&' + assert IrcMessage[server: 'irc.example.org', cmd: '005', args: ['nick', 'PREFIX=(ov)@+', 'CHANTYPES=#&']] = Utils.parse(message) + end + +end |