From 0aa93acab0365bef21d2972c105d3d11aaa99648 Mon Sep 17 00:00:00 2001 From: Didactic Drunk <1479616+didactic-drunk@users.noreply.github.com> Date: Tue, 15 Jun 2021 15:42:53 -0700 Subject: [PATCH] Remove old spec file --- spec/not_spec.cr | 42 ------------------------------------------ 1 file changed, 42 deletions(-) delete mode 100644 spec/not_spec.cr diff --git a/spec/not_spec.cr b/spec/not_spec.cr deleted file mode 100644 index d94f888..0000000 --- a/spec/not_spec.cr +++ /dev/null @@ -1,42 +0,0 @@ -require "./spec_helper" -require "../src/crypto-secret/not" - -describe Crypto::Secret::Not do - it "works" do - ksize = 32 - key = Bytes.new ksize - key[1] = 1_u8 - - secret1 = Crypto::Secret::Not.copy_from key - secret1.readonly { |s| s.should eq key } - - secret2 = Crypto::Secret::Not.copy_from key - - (secret1 == secret2).should be_true - secret1.readonly do |s1| - secret2.readonly do |s2| - (s1 == s2).should be_true - end - end - end - - it "bytesize" do - secret = Crypto::Secret::Not.new 5 - secret.bytesize.should eq 5 - secret.readonly { |s| s.bytesize.should eq 5 } - end - - it "doesn't leak key material when inspecting" do - secret = Crypto::Secret::Not.new 5 - secret.to_s.should match /\(\*\*\*SECRET\*\*\*\)$/ - secret.inspect.should match /\(\*\*\*SECRET\*\*\*\)$/ - secret.to_s.should_not match /Bytes|Slice/ - secret.inspect.should_not match /Bytes|Slice/ - end - - it "returns a random secret" do - secret1 = Crypto::Secret::Not.new 8 - secret2 = Crypto::Secret::Not.random 8 - secret1.should_not eq secret2 - end -end