Created
May 9, 2017 20:52
-
-
Save adkron/439245e01b614eb8b93582d3074b375e to your computer and use it in GitHub Desktop.
This file contains hidden or 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
defmodule Zwave.Command.Test do | |
use ExUnit.Case, async: true | |
alias Zwave.Command | |
test "A non matching type passes through when deserialized" do | |
thing = make_ref() | |
assert thing == Command.Deserializable.deserialize(thing) | |
end | |
test "A binary being serialized should be the same" do | |
binary = <<Enum.random(1..255)>> | |
assert binary == Command.Serializable.serialize(binary) | |
end | |
test "Serializing something that we don't know how to serialize" do | |
error = catch_error(Command.Serializable.serialize(:bad)) | |
assert %Protocol.UndefinedError{} == error | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment