Sha256: 28d321f2f69ce5842889867d0247627d78650070923c524d986654950fe81ef6

Contents?: true

Size: 1.69 KB

Versions: 2

Compression:

Stored size: 1.69 KB

Contents

# encoding: utf-8

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

describe Backup::Configuration::Database::MySQL do
  before do
    Backup::Configuration::Database::MySQL.defaults do |db|
      db.name               = 'mydb'
      db.username           = 'myuser'
      db.password           = 'mypassword'
      db.host               = 'myhost'
      db.port               = 'myport'
      db.socket             = 'mysocket'
      db.skip_tables        = %w[my tables]
      db.only_tables        = %w[my other tables]
      db.additional_options = %w[my options]
    end
  end

  it 'should set the default MySQL configuration' do
    db = Backup::Configuration::Database::MySQL
    db.name.should               == 'mydb'
    db.username.should           == 'myuser'
    db.password.should           == 'mypassword'
    db.host.should               == 'myhost'
    db.port.should               == 'myport'
    db.socket.should             == 'mysocket'
    db.skip_tables.should        == %w[my tables]
    db.only_tables.should        == %w[my other tables]
    db.additional_options.should == %w[my options]
  end

  describe '#clear_defaults!' do
    it 'should clear all the defaults, resetting them to nil' do
      Backup::Configuration::Database::MySQL.clear_defaults!

      db = Backup::Configuration::Database::MySQL
      db.name.should               == nil
      db.username.should           == nil
      db.password.should           == nil
      db.host.should               == nil
      db.port.should               == nil
      db.socket.should             == nil
      db.skip_tables.should        == nil
      db.only_tables.should        == nil
      db.additional_options.should == nil
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
backup-3.0.19 spec/configuration/database/mysql_spec.rb
backup-3.0.18 spec/configuration/database/mysql_spec.rb