test/cipher_test.rb in symmetric-encryption-4.1.0.beta1 vs test/cipher_test.rb in symmetric-encryption-4.1.0
- old
+ new
@@ -91,11 +91,11 @@
cipher_name: cipher_name,
encoding: encoding,
always_add_header: always_add_header
)
- h = @encrypted_values[cipher_name][encoding] if @encrypted_values[cipher_name]
+ h = @encrypted_values[cipher_name][encoding] if @encrypted_values[cipher_name]
skip "Add @encrypted_values for cipher_name: #{cipher_name} and encoding: #{encoding}, value: #{@cipher.encrypt(@social_security_number).inspect}" unless h
@social_security_number_encrypted = h[always_add_header ? :header : :no_header]
@social_security_number_encrypted.force_encoding(Encoding.find('binary')) if encoding == :none
end
@@ -148,11 +148,11 @@
end
end
describe 'with configuration' do
before do
- @cipher = SymmetricEncryption::Cipher.new(
+ @cipher = SymmetricEncryption::Cipher.new(
key: '1234567890ABCDEF',
iv: '1234567890ABCDEF',
cipher_name: 'aes-128-cbc',
encoding: :none
)
@@ -179,10 +179,10 @@
true,
key.iv,
key.key,
key.cipher_name
)
- header = SymmetricEncryption::Header.new
+ header = SymmetricEncryption::Header.new
header.parse(binary_header)
assert_equal true, header.compressed?
assert random_cipher = SymmetricEncryption::Cipher.new(iv: key.iv, key: key.key, cipher_name: key.cipher_name)
assert_equal random_cipher.cipher_name, header.cipher_name, 'Ciphers differ'
assert_equal random_cipher.send(:key), header.key, 'Keys differ'