diff --git a/test/diffcrypt/encryptor_test.rb b/test/diffcrypt/encryptor_test.rb index 7fa3e20..f154f39 100644 --- a/test/diffcrypt/encryptor_test.rb +++ b/test/diffcrypt/encryptor_test.rb @@ -48,6 +48,7 @@ def test_it_decrypts_nested_structures data: array: - item1: 7HJjrwQ6KqH+jvu1pOZGqQ==--E2ipnCNCszD6oixM--QZapG/8wrPtwbUVDe9evsw== + subitem: oNNLBGwL45VvOv7elkRTHZTcNQ==--iFBc53R3F26zsvTK--6iEtqH7TR7TSS6fJOHwfPg== - item2: IvwdxcAV+38MvNsKYdNCEg==--6y7Aj4nmFLOTGrx3--rRH8ni3yks2eid91jde2hg== secret_key_base: 88Ry6HESUoXBr6QUFXmni9zzfCIYt9qGNFvIWFcN--4xoecI5mqbNRBibI--62qPJbkzzh5h8lhFEFOSaQ== aws: @@ -58,6 +59,7 @@ def test_it_decrypts_nested_structures --- array: - item1: value1 + subitem: value sub - item2: value2 secret_key_base: secret_key_base_test aws: @@ -74,10 +76,13 @@ def test_it_encrypts_nested_structures aws: access_key_id: AKIAXXX array: - - item1: value1 - - item2: value2 + - item1: value1 + subitem: value sub + - item2: value2 CONTENT - expected_pattern = /---\narray:\n- item1: #{ENCRYPTED_VALUE_PATTERN}\n- item2: #{ENCRYPTED_VALUE_PATTERN}\naws:\n access_key_id: #{ENCRYPTED_VALUE_PATTERN}\nsecret_key_base: #{ENCRYPTED_VALUE_PATTERN}/ + expected_pattern = /---\narray:\n- item1: #{ENCRYPTED_VALUE_PATTERN}\n subitem: #{ENCRYPTED_VALUE_PATTERN}\n- item2: #{ENCRYPTED_VALUE_PATTERN}\naws:\n access_key_id: #{ENCRYPTED_VALUE_PATTERN}\nsecret_key_base: #{ENCRYPTED_VALUE_PATTERN}/ + + pp Diffcrypt::Encryptor.new(TEST_KEY_128, cipher: 'aes-128-gcm').encrypt_data(content).to_yaml assert_match expected_pattern, Diffcrypt::Encryptor.new(TEST_KEY_128, cipher: 'aes-128-gcm').encrypt_data(content).to_yaml end