Sha256: 351fd3fe2fa2e2205f39e859359520f5afb52ad77905cd8019943b51f41d57c0

Contents?: true

Size: 1.31 KB

Versions: 4

Compression:

Stored size: 1.31 KB

Contents

# encoding: utf-8

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

describe Backup::Configuration::Storage::CloudFiles do
  before do
    Backup::Configuration::Storage::CloudFiles.defaults do |cf|
      cf.username   = 'my_username'
      cf.api_key    = 'my_api_key'
      cf.container  = 'my_container'
      cf.path       = 'my_backups'
      cf.auth_url   = 'lon.auth.api.rackspacecloud.com'
      cf.servicenet = true
    end
  end
  after { Backup::Configuration::Storage::CloudFiles.clear_defaults! }

  it 'should set the default Cloud Files configuration' do
    cf = Backup::Configuration::Storage::CloudFiles
    cf.username.should   == 'my_username'
    cf.api_key.should    == 'my_api_key'
    cf.container.should  == 'my_container'
    cf.path.should       == 'my_backups'
    cf.auth_url.should   == 'lon.auth.api.rackspacecloud.com'
    cf.servicenet.should == true
  end

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

      cf = Backup::Configuration::Storage::CloudFiles
      cf.username.should   == nil
      cf.api_key.should    == nil
      cf.container.should  == nil
      cf.path.should       == nil
      cf.auth_url.should   == nil
      cf.servicenet.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/cloudfiles_spec.rb
backup-3.0.23 spec/configuration/storage/cloudfiles_spec.rb
backup-3.0.22 spec/configuration/storage/cloudfiles_spec.rb
backup-3.0.21 spec/configuration/storage/cloudfiles_spec.rb