Sha256: e3583df4546ffcc103494c5572a969a36d7b331d91994533638dad47c5f8ee85

Contents?: true

Size: 1.22 KB

Versions: 4

Compression:

Stored size: 1.22 KB

Contents

# encoding: utf-8

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

describe Backup::Configuration::Storage::SFTP do
  before do
    Backup::Configuration::Storage::SFTP.defaults do |sftp|
      sftp.username  = 'my_username'
      sftp.password  = 'my_password'
      sftp.ip        = '123.45.678.90'
      sftp.port      = 22
      sftp.path      = 'my_backups'
      sftp.keep      = 20
    end
  end
  after { Backup::Configuration::Storage::SFTP.clear_defaults! }

  it 'should set the default sftp configuration' do
    sftp = Backup::Configuration::Storage::SFTP
    sftp.username.should == 'my_username'
    sftp.password.should == 'my_password'
    sftp.ip.should       == '123.45.678.90'
    sftp.port.should     == 22
    sftp.path.should     == 'my_backups'
    sftp.keep.should     == 20
  end

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

      sftp = Backup::Configuration::Storage::SFTP
      sftp.username.should == nil
      sftp.password.should == nil
      sftp.ip.should       == nil
      sftp.port.should     == nil
      sftp.path.should     == nil
      sftp.keep.should     == nil
    end
  end
end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
backup_checksum-3.0.23 spec/configuration/storage/sftp_spec.rb
backup-3.0.23 spec/configuration/storage/sftp_spec.rb
backup-3.0.22 spec/configuration/storage/sftp_spec.rb
backup-3.0.21 spec/configuration/storage/sftp_spec.rb