              "foo">>
 
     list = {:link_list, [%RID{cluster_id: 1, position: 2}, %RID{cluster_id: 8, position: 9}]}
-    assert Ser.decode_type(data, :link_list) == {list, "foo"}
+    assert decode_type(data, :link_list) == {list, "foo"}
   end
 
   test "decode_type/2: link sets" do

  end

  test "encode_value/1: datetime" do
    import Ser, only: [encode_value: 1]

    datetime = %DateTime{year: 2015, month: 6, day: 30,
                         hour: 12, min: 03, sec: 29, msec: 901}
    assert bin(encode_value(datetime)) == :small_ints.encode_zigzag_varint(1435665809901)
  end

  test "encode_value/1: embedded lists" do
    import Ser, only: [encode_value: 1]

    assert (bin(encode_value(["elem", true])) <> "foo") == @list
  end

  test "encode_value/1: embedded sets" do
    import Ser, only: [encode_value: 1]

    expected = <<4,            # number of items (zigzag, hence 2)
                 23,           # type of the elems in the list, OrientDB only supports ANY
                 0, 1,         # elem type (boolean) + value

    data = :small_ints.encode_zigzag_varint(1435665809901) <> "foo"
    datetime = %DateTime{year: 2015, month: 6, day: 30,
                         hour: 12, min: 03, sec: 29, msec: 901}
    assert decode_type(data, :datetime) == {datetime, "foo"}
  end

  test "decode_type/2: embedded documents" do
    # Embedded documents have no serialization version
    <<_version, record :: bytes>> = @record_with_fields

    assert decode_type(record, :embedded) ==
           {%Record{class: "foo", fields: %{"hello" => "world!", "int" => 12}}, "rest"}
  end

  test "decode_type/2: embedded lists" do
    assert decode_type(@list, :embedded_list) == {["elem", true], "foo"}
  end

  test "decode_type/2: embedded sets" do
    expected_set = Enum.into(["elem", true], HashSet.new)
    assert decode_type(@list, :embedded_set) == {expected_set, "foo"}
  end

  test "decode_type/2: embedded maps" do
