test/cipher_test.rb in symmetric-encryption-3.0.2 vs test/cipher_test.rb in symmetric-encryption-3.0.3
- old
+ new
@@ -75,9 +75,25 @@
should "encrypt simple string" do
assert_equal @social_security_number_encrypted, @cipher.encrypt(@social_security_number)
end
+ should "return nil when encrypting nil" do
+ assert_equal nil, @cipher.encrypt(nil)
+ end
+
+ should "return '' when encrypting ''" do
+ assert_equal '', @cipher.encrypt('')
+ end
+
+ should "return nil when decrypting nil" do
+ assert_equal nil, @cipher.decrypt(nil)
+ end
+
+ should "return '' when decrypting ''" do
+ assert_equal '', @cipher.decrypt('')
+ end
+
should "decrypt string" do
assert_equal @social_security_number, @cipher.decrypt(@social_security_number_encrypted)
end
if defined?(Encoding)
\ No newline at end of file