Sha256: b01530b6e8883218d3b100b6631fe3249a290a05c85182d847f814a58e84d189

Contents?: true

Size: 898 Bytes

Versions: 1

Compression:

Stored size: 898 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 "sets #{k} to #{v}" do
        @pg.backup.send(k).should == v
      end
    end

  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
webtranslateit-safe-0.4.0 spec/webtranslateit/safe/pgdump_spec.rb