Skip to content

Instantly share code, notes, and snippets.

@adkron
Created May 9, 2017 20:52
Show Gist options
  • Save adkron/439245e01b614eb8b93582d3074b375e to your computer and use it in GitHub Desktop.
Save adkron/439245e01b614eb8b93582d3074b375e to your computer and use it in GitHub Desktop.
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