Sha256: ae354e16074a8554e5f8c09575bb4af4dce516b5c8fa418af869696e0885870e

Contents?: true

Size: 1.17 KB

Versions: 14

Compression:

Stored size: 1.17 KB

Contents

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

require 'replication_extender_interface_spec.rb'
require 'postgresql_replication_spec.rb'

include RR

extenders = [:postgres, :mysql]

extenders.each do |extender|
  describe "#{extender.to_s.capitalize} Replication Extender" do
    before(:each) do
      @org_test_db = ENV['RR_TEST_DB']
      ENV['RR_TEST_DB'] = extender.to_s
      Initializer.configuration = standard_config
    end

    after(:each) do
      ENV['RR_TEST_DB'] = @org_test_db
    end

    begin
      if ENV['RR_TEST_DB'] != @org_test_db.to_s
        # If the current adapter is *not* the adapter for the standard tests
        # (meaning the adapter which is used to run all other tests)
        # then only run the extender spec if the database connection is available
        Session.new read_config(extender)
      end
      it_should_behave_like "ReplicationExtender"
      it_should_behave_like "PostgreSQLReplication" if extender == :postgres
    rescue Exception => e
      at_exit do
        puts "#{__FILE__}:#{__LINE__}: DB Connection failed with '#{e}' ==> #{extender.to_s.capitalize} replication extender not tested"
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
rubyrep-1.2.0 spec/db_specific_replication_extenders_spec.rb
rubyrep-1.1.2 spec/db_specific_replication_extenders_spec.rb
rubyrep-1.1.1 spec/db_specific_replication_extenders_spec.rb
rubyrep-1.1.0 spec/db_specific_replication_extenders_spec.rb
rubyrep-1.0.9 spec/db_specific_replication_extenders_spec.rb
rubyrep-1.0.8 spec/db_specific_replication_extenders_spec.rb
rubyrep-1.0.3 spec/db_specific_replication_extenders_spec.rb
rubyrep-1.0.4 spec/db_specific_replication_extenders_spec.rb
rubyrep-1.0.5 spec/db_specific_replication_extenders_spec.rb
rubyrep-1.0.6 spec/db_specific_replication_extenders_spec.rb
rubyrep-1.0.7 spec/db_specific_replication_extenders_spec.rb
rubyrep-1.0.2 spec/db_specific_replication_extenders_spec.rb
rubyrep-1.0.1 spec/db_specific_replication_extenders_spec.rb
rubyrep-1.0.0 spec/db_specific_replication_extenders_spec.rb