diff --git a/spec/cbor_simple-values.cr b/spec/cbor_simple-values.cr new file mode 100644 index 0000000..f35c85a --- /dev/null +++ b/spec/cbor_simple-values.cr @@ -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 +