Sha256: 2b94bcb2982ecc863935a21461cb527b3d17e4ee8bb1f89a8fa6a8a436e0103e

Contents?: true

Size: 961 Bytes

Versions: 14

Compression:

Stored size: 961 Bytes

Contents

require File.expand_path(File.dirname(__FILE__) + '/../example_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

14 entries across 14 versions & 3 rubygems

Version Path
astrails-safe-0.1.10 examples/unit/pgdump_example.rb
astrails-safe-0.1.7 examples/unit/pgdump_example.rb
astrails-safe-0.1.8 examples/unit/pgdump_example.rb
astrails-safe-0.1.9 examples/unit/pgdump_example.rb
astrails-safe-0.2.0 examples/unit/pgdump_example.rb
astrails-safe-0.2.1 examples/unit/pgdump_example.rb
astrails-safe-0.2.2 examples/unit/pgdump_example.rb
astrails-safe-0.2.3 examples/unit/pgdump_example.rb
bostonlogic-safe-0.3.0 examples/unit/pgdump_example.rb
astrails-safe-0.2.7 examples/unit/pgdump_example.rb
astrails-safe-0.2.6 examples/unit/pgdump_example.rb
astrails-safe-0.2.5 examples/unit/pgdump_example.rb
webbynode-safe-0.2.5 examples/unit/pgdump_example.rb
astrails-safe-0.2.4 examples/unit/pgdump_example.rb