Sha256: 5dee3722e195aefa51f1e5173e915a3e89ff7af74e6e88b64755628a5ab70c77

Contents?: true

Size: 1.11 KB

Versions: 4

Compression:

Stored size: 1.11 KB

Contents

# encoding: utf-8

require File.expand_path('../../../spec_helper.rb', __FILE__)

describe Backup::Configuration::Encryptor::OpenSSL do
  before do
    Backup::Configuration::Encryptor::OpenSSL.defaults do |encryptor|
      encryptor.password = 'my_password'
      encryptor.password_file = nil
      encryptor.base64   = true
      encryptor.salt     = true
    end
  end
  after { Backup::Configuration::Encryptor::OpenSSL.clear_defaults! }

  it 'should set the default encryptor configuration' do
    encryptor = Backup::Configuration::Encryptor::OpenSSL
    encryptor.password.should == 'my_password'
    encryptor.password_file.should == nil
    encryptor.base64.should   == true
    encryptor.salt.should     == true
  end

  describe '#clear_defaults!' do
    it 'should clear all the defaults, resetting them to nil' do
      Backup::Configuration::Encryptor::OpenSSL.clear_defaults!

      encryptor = Backup::Configuration::Encryptor::OpenSSL
      encryptor.password.should == nil
      encryptor.password_file.should == nil
      encryptor.base64.should   == nil
      encryptor.salt.should     == nil
    end
  end
end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
backup_checksum-3.0.23 spec/configuration/encryptor/open_ssl_spec.rb
backup-3.0.23 spec/configuration/encryptor/open_ssl_spec.rb
backup-3.0.22 spec/configuration/encryptor/open_ssl_spec.rb
backup-3.0.21 spec/configuration/encryptor/open_ssl_spec.rb