Sha256: 3c3f67a33436b19148a7c1973a215e4fde6b7d335d117057577d4ae287dd734c

Contents?: true

Size: 834 Bytes

Versions: 1

Compression:

Stored size: 834 Bytes

Contents

# encoding: utf-8

require File.expand_path('../../spec_helper.rb', __FILE__)

describe Backup::Database::Base do

  before do
    class Backup::Database::Base
      def initialize(&block)
        instance_eval(&block) if block_given?
      end
    end
  end

  let(:db) do
    Backup::Database::Base.new do |db|
      db.utility_path = '/var/usr/my_util'
    end
  end

  it 'should return the utility path instead of auto-detecting it' do
    db.utility(:my_database_util).should == '/var/usr/my_util'
  end

  it 'should ignore the utility_path when not defined' do
    db = Backup::Database::Base.new
    db.utility(:my_database_util).should == :my_database_util
  end

  describe '#perform!' do
    it 'should invoke prepare! and log!' do
      db.expects(:prepare!)
      db.expects(:log!)

      db.perform!
    end
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
backup-3.0.20 spec/database/base_spec.rb