Add CBOR Time tests.

remotes/dev/pr-multi
Karchnu 2021-06-21 19:34:40 +02:00
parent 8a0eeb9dc1
commit a62d3965da
1 changed files with 15 additions and 0 deletions

15
spec/cbor_time.cr Normal file
View File

@ -0,0 +1,15 @@
require "./spec_helper"
describe CBOR do
describe "Time" do
it "Time#to_cbor" do
time = Time.utc(2016, 2, 15, 10, 20, 30)
time.to_cbor.hexstring.should eq "c074323031362d30322d31355431303a32303a33305a"
end
it "Time#from_cbor" do
time = Time.from_cbor Time.utc(2016, 2, 15, 10, 20, 30).to_cbor
time.to_cbor.hexstring.should eq "c074323031362d30322d31355431303a32303a33305a"
end
end
end