Sha256: fb8f4e5aad6c95e8c557399fb64fc9b48d6cb9d8138387dda3a19663cc4c94e8

Contents?: true

Size: 790 Bytes

Versions: 3

Compression:

Stored size: 790 Bytes

Contents

require "spec_helper"
require "heroku/client"

describe Heroku::Client::PgbackupsArchive do
  let(:archive) { Heroku::Client::PgbackupsArchive.new(:pgbackups_url => "https://ip:password@pgbackups.heroku.com/client") }
  let(:backup) { { "finished_at" => "some timestamp" } }

  it "should use a pgbackup client" do
    archive.client.class.should eq Heroku::Client::Pgbackups
  end

  context "given a finished_at timestamp" do
    before { archive.client.stub(:create_transfer).and_return(backup) }

    it "should capture the backup" do
      archive.capture.should eq backup
    end

    it "should store the backup" do
      archive.stub(:key).and_return("key")
      archive.stub(:file).and_return("file")
      archive.store.class.should eq Fog::Storage::AWS::File
    end
  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
pgbackups-archive-0.0.4 spec/lib/pgbackups-archive/heroku/client/pgbackups_archive_spec.rb
pgbackups-archive-0.0.3 spec/lib/pgbackups-archive/heroku/client/pgbackups_archive_spec.rb
pgbackups-archive-0.0.1 spec/lib/pgbackups-archive/heroku/client/pgbackups_archive_spec.rb