Sha256: 140dc8bd2e9804493f1bae5f9f317e58f3a26bcddff7c3e29e138abc8d64904f

Contents?: true

Size: 1.11 KB

Versions: 11

Compression:

Stored size: 1.11 KB

Contents

require File.expand_path('../helper', __FILE__)
require File.expand_path('../test_backup_local', __FILE__)

class TestCloudBackup < TestLocalBackup
  def setup
    @restore_path = File.expand_path("../fixtures/restore", __FILE__)
    @hostname = Socket.gethostname

    cloud_rc = YAML::load open(
      File.expand_path "../cloudrc.yml", __FILE__
    ).read

    @backups_path = cloud_rc["directory"]
    @backup = Backup::Instance.new(
      @backups_path,
      true,
      :key => cloud_rc["key"],
      :secret => cloud_rc["secret"],
      :bucket => cloud_rc["bucket"]
    )
  end

  def teardown
    FileUtils.rm_r @restore_path, :force => true
    FileUtils.mkdir_p @restore_path

    File.open(File.expand_path('../fixtures/etc/root/file', __FILE__), 'w') do |f|
      f.puts "Root file\n"
    end

    @backup.file_item.delete_dir @backups_path
  end

  def test_backup_attributes
    assert_equal(
      @backup.root_path,
      "#{@backups_path}/#{@hostname}"
    )
    assert_equal @backup.hostname, @hostname
    assert_equal @backup.file_item.class, Backup::FileItem::Cloud
    assert_not_nil @backup.timestamp
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
encbs-0.2.5.1 test/test_backup_cloud.rb
encbs-0.2.5 test/test_backup_cloud.rb
encbs-0.2.4.6 test/test_backup_cloud.rb
encbs-0.2.4.5 test/test_backup_cloud.rb
encbs-0.2.4.4 test/test_backup_cloud.rb
encbs-0.2.4.3 test/test_backup_cloud.rb
encbs-0.2.4.2 test/test_backup_cloud.rb
encbs-0.2.4.1 test/test_backup_cloud.rb
encbs-0.2.4 test/test_backup_cloud.rb
encbs-0.2.3 test/test_backup_cloud.rb
encbs-0.2.2 test/test_backup_cloud.rb