Sha256: fc5cae009826863d9f118ba18a0d3111ecc957704cd3088fabb0cf37c83f55f8

Contents?: true

Size: 805 Bytes

Versions: 22

Compression:

Stored size: 805 Bytes

Contents

# encoding: utf-8

require File.dirname(__FILE__) + '/../spec_helper'

describe Backup::Storage::Base do
  let(:base) { Backup::Storage::Base.new }

  before do
    Backup::Logger.stubs(:message)
  end

  it do
    storage_object = mock
    Backup::Storage::Object.expects(:new).with('Base').returns(storage_object)
    storage_object.stubs(:load).returns([])
    storage_object.expects(:write)
    base.keep = 1
    base.cycle!
  end

  it do
    base.keep = 3
    storage_object = mock
    objects = %w[1 2 3 4].map { Backup::Storage::Base.new }

    Backup::Storage::Object.expects(:new).with('Base').returns(storage_object)
    storage_object.stubs(:load).returns(objects)
    storage_object.expects(:write)
    Backup::Storage::Base.any_instance.expects(:remove!).times(2)

    base.cycle!
  end
end

Version data entries

22 entries across 22 versions & 3 rubygems

Version Path
interu-backup-3.0.16 spec/storage/base_spec.rb
backup-3.0.16 spec/storage/base_spec.rb
backup-3.0.15 spec/storage/base_spec.rb
backup-3.0.14 spec/storage/base_spec.rb
backup-3.0.13 spec/storage/base_spec.rb
backup-3.0.12 spec/storage/base_spec.rb
backup-3.0.11 spec/storage/base_spec.rb
alg-backup-3.0.10 spec/storage/base_spec.rb
backup-3.0.10 spec/storage/base_spec.rb
backup-3.0.9 spec/storage/base_spec.rb
backup-3.0.8 spec/storage/base_spec.rb
backup-3.0.7 spec/storage/base_spec.rb
backup-3.0.6 spec/storage/base_spec.rb
backup-3.0.5 spec/storage/base_spec.rb
backup-3.0.4 spec/storage/base_spec.rb
backup-3.0.3 spec/storage/base_spec.rb
backup-3.0.2.build.0 spec/storage/base_spec.rb
backup-3.0.2 spec/storage/base_spec.rb
backup-3.0.1.build.0 spec/storage/base_spec.rb
backup-3.0.1 spec/storage/base_spec.rb