Sha256: fb855e9e706ee08f1d8500a13847a05cffa7f4e2469b6a559d5bc3177a055cef

Contents?: true

Size: 936 Bytes

Versions: 2

Compression:

Stored size: 936 Bytes

Contents

require 'spec_helper'

describe WebTranslateIt::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)
    WebTranslateIt::Safe::Pgdump.new(id, WebTranslateIt::Safe::Config::Node.new(nil, config))
  end

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

  after(:each) { WebTranslateIt::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

2 entries across 2 versions & 1 rubygems

Version Path
webtranslateit-safe-0.4.2 spec/webtranslateit/safe/pgdump_spec.rb
webtranslateit-safe-0.4.1 spec/webtranslateit/safe/pgdump_spec.rb