Sha256: 9668c2d6bf497464477142cab286f2a63abc58d3173ee181662d9915359c81a5

Contents?: true

Size: 1.36 KB

Versions: 3

Compression:

Stored size: 1.36 KB

Contents

# encoding: utf-8

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

describe Backup::Configuration::Syncer::CloudFiles do
  before do
    Backup::Configuration::Syncer::CloudFiles.defaults do |cf|
      cf.username   = 'my-username'
      cf.api_key    = 'my-api-key'
      cf.container  = 'my-container'
      cf.auth_url   = 'my-auth-url'
      cf.servicenet = true
      cf.path       = '/backups/'
      cf.mirror     = true
    end
  end
  after { Backup::Configuration::Syncer::CloudFiles.clear_defaults! }

  it 'should set the default cloud files configuration' do
    cf = Backup::Configuration::Syncer::CloudFiles
    cf.username.should   == 'my-username'
    cf.api_key.should    == 'my-api-key'
    cf.container.should  == 'my-container'
    cf.auth_url.should   == 'my-auth-url'
    cf.servicenet.should == true
    cf.path.should       == '/backups/'
    cf.mirror.should     == true
  end

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

      cf = Backup::Configuration::Syncer::CloudFiles
      cf.username.should   == nil
      cf.api_key.should    == nil
      cf.container.should  == nil
      cf.auth_url.should   == nil
      cf.servicenet.should == nil
      cf.path.should       == nil
      cf.mirror.should     == nil
    end
  end
end

Version data entries

3 entries across 3 versions & 2 rubygems

Version Path
backup_checksum-3.0.23 spec/configuration/syncer/cloud_files_spec.rb
backup-3.0.23 spec/configuration/syncer/cloud_files_spec.rb
backup-3.0.22 spec/configuration/syncer/cloud_files_spec.rb