Sha256: fffb152b0811d5e907f62be819d032be2e92da8490b26715bd82e3d6782e11ba

Contents?: true

Size: 959 Bytes

Versions: 5

Compression:

Stored size: 959 Bytes

Contents

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

describe Astrails::Safe::Pgdump do

  def def_config
    {
      :options => "OPTS",
      :user => "User",
      :password => "pwd",
      :host => "localhost",
      :port => 7777,
      :skip_tables => [:bar, :baz]
    }
  end

  def pgdump(id = :foo, config = def_config)
    Astrails::Safe::Pgdump.new(id, Astrails::Safe::Config::Node.new(nil, config))
  end

  before(:each) do
    stub(Time).now.stub!.strftime {"NOW"}
  end

  after(:each) { Astrails::Safe::TmpFile.cleanup }

  describe :backup do
    before(:each) do
      @pg = pgdump
    end

    {
      :id => "foo",
      :kind => "pgdump",
      :extension => ".sql",
      :filename => "pgdump-foo.NOW",
      :command => "pg_dump OPTS --username='User' --host='localhost' --port='7777' foo",
    }.each do |k, v|
      it "should set #{k} to #{v}" do
        @pg.backup.send(k).should == v
      end
    end

  end

end

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
netguru-safe-0.2.11 spec/unit/pgdump_spec.rb
netguru-safe-0.2.10 spec/unit/pgdump_spec.rb
netguru-safe-0.2.9 spec/unit/pgdump_spec.rb
darkofabijan-astrails-safe-0.2.9 spec/unit/pgdump_spec.rb
darkofabijan-astrails-safe-0.2.8 spec/unit/pgdump_spec.rb