test/key_test.rb in symmetric-encryption-4.0.0.beta3 vs test/key_test.rb in symmetric-encryption-4.0.0

- old
+ new

@@ -1,9 +1,18 @@ require_relative 'test_helper' class KeyTest < Minitest::Test describe SymmetricEncryption::Key do + before do + Dir.mkdir('tmp') unless Dir.exist?('tmp') + end + + after do + # Cleanup generated encryption key files. + `rm tmp/dek_tester* 2> /dev/null` + end + let :random_key do SymmetricEncryption::Key.new end let :stored_key do @@ -110,10 +119,10 @@ let :config_key do SymmetricEncryption::Key.from_config(config) end let :dek_file_name do - 'tmp/tester_dek.encrypted_key' + 'tmp/dek_tester_dek.encrypted_key' end describe 'key' do it 'key' do assert_equal stored_key, config_key.key