Sha256: a580624f4a6cd22c18f4789d4f133cbc64e0243521243e131bbe50f22c10a585

Contents?: true

Size: 921 Bytes

Versions: 4

Compression:

Stored size: 921 Bytes

Contents

require "test_helper"

describe PgbackupsArchive::Storage do
  let(:connection) {
    Fog::Storage.new(
      :provider              => "AWS",
      :aws_access_key_id     => "XXX",
      :aws_secret_access_key => "YYY")
  }
  let(:bucket)     { connection.directories.create(:key => "someapp-backups") }
  let(:key)        { "pgbackups/test/2012-08-02-12-00-00.dump" }
  let(:file)       { "test" }
  let(:storage)    { PgbackupsArchive::Storage.new(key, file) }

  before do
    Fog.mock!
    storage.stubs(:connection).returns(connection)
    storage.stubs(:bucket).returns(bucket)
  end

  it "should create a fog connection" do
    storage.connection.class.must_equal Fog::Storage::AWS::Mock
  end

  it "should create a fog directory" do
    storage.bucket.class.must_equal Fog::Storage::AWS::Directory
  end

  it "should create a fog file" do
    storage.store.class.must_equal Fog::Storage::AWS::File
  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
pgbackups-archive-0.3.0 test/lib/pgbackups-archive/storage_test.rb
pgbackups-archive-0.2.4 test/lib/pgbackups-archive/storage_test.rb
pgbackups-archive-0.2.3 test/lib/pgbackups-archive/storage_test.rb
pgbackups-archive-0.2.2 test/lib/pgbackups-archive/storage_test.rb