test/test.rb in digest-kangarootwelve-0.1.0 vs test/test.rb in digest-kangarootwelve-0.1.1
- old
+ new
@@ -83,13 +83,22 @@
b.customization.must_equal a.customization
c.customization.must_equal a.customization
d.customization.must_equal a.customization
end
+ it "has a customization method that returns nil when customization string is undefined" do
+ Digest::KangarooTwelve.implement.customization.must_be_nil
+ end
+
+ it "has a customization_hex method that returns hex of customization string, or nil" do
+ Digest::KangarooTwelve.implement(c: "abcd").customization_hex.must_equal "61626364"
+ Digest::KangarooTwelve.implement.customization_hex.must_be_nil
+ end
+
it "has a declared block length of 8192 bytes" do
- Digest::KangarooTwelve::BLOCK_LENGTH == 8192
- Digest::KangarooTwelve.default.block_length == 8192
- Digest::KangarooTwelve.default.new.block_length == 8192
+ Digest::KangarooTwelve::BLOCK_LENGTH.must_equal 8192
+ Digest::KangarooTwelve.default.block_length.must_equal 8192
+ Digest::KangarooTwelve.default.new.block_length.must_equal 8192
end
it "produces valid hashes" do
# KangarooTwelve(M=empty, C=empty, 32 bytes):
Digest::KangarooTwelve[32].new.hexdigest("").must_equal "1ac2d450fc3b4205d19da7bfca1b37513c0803577ac7167f06fe2ce1f0ef39e5"