Add CBOR simple value encoding tests (Bool or Nil).

remotes/dev/pr-bools
Karchnu 2021-06-21 22:40:47 +02:00
parent 132368c4f1
commit b0ed7aa477
1 changed files with 15 additions and 0 deletions

View File

@ -0,0 +1,15 @@
require "./spec_helper"
describe CBOR do
describe "basics: to_cbor" do
it "union (Nil | Bool) (nil)" do
value = (Nil | Bool).from_cbor(nil.to_cbor).to_cbor
value.hexstring.should eq "f6"
end
it "union (Nil | Bool) (false)" do
value = (Nil | Bool).from_cbor(false.to_cbor).to_cbor
value.hexstring.should eq "f4"
end
end
end