From fe3d434209c6084a3e31d394ab75e04ef96641b1 Mon Sep 17 00:00:00 2001 From: Karchnu Date: Mon, 21 Jun 2021 18:53:04 +0200 Subject: [PATCH] Add CBOR UUID encoding and decoding tests. --- spec/cbor_uuid.cr | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 spec/cbor_uuid.cr diff --git a/spec/cbor_uuid.cr b/spec/cbor_uuid.cr new file mode 100644 index 0000000..64aaa1b --- /dev/null +++ b/spec/cbor_uuid.cr @@ -0,0 +1,15 @@ +require "./spec_helper" + +describe CBOR do + describe "UUID" do + it "UUID#to_cbor" do + uuid = UUID.new "fc47eb8e-b13c-481e-863a-8f8c47a550f2" + uuid.to_cbor.hexstring.should eq "50fc47eb8eb13c481e863a8f8c47a550f2" + end + + it "UUID#from_cbor" do + uuid = UUID.from_cbor "50fc47eb8eb13c481e863a8f8c47a550f2".hexbytes + uuid.to_cbor.hexstring.should eq "50fc47eb8eb13c481e863a8f8c47a550f2" + end + end +end