Sha256: 5ca23c779c961e9f2c5721f4340a2e8c686cf661d314ab84549af87e000045bd

Contents?: true

Size: 932 Bytes

Versions: 12

Compression:

Stored size: 932 Bytes

Contents

ENV["AR_ENV"] ="test"
require 'connection_manager'
require 'rspec'
require 'bundler/setup'
require 'active_record'
require 'active_support'
require 'logger'
require 'factory_girl'
require 'helpers/database_spec_helper'
if(defined? RUBY_ENGINE and 'jruby' == RUBY_ENGINE)
  TestDB.connect('jdbcmysql')
else
  TestDB.connect('mysql2')
end

TestMigrations.down
TestMigrations.up
FactoryGirl.find_definitions
RSpec.configure do |config|
  config.mock_with :mocha 
  # Loads database.yml and establishes primary connection
  # Create tables when tests are completed
  config.before(:all) {
    require 'helpers/models_spec_helper.rb'    
  }  
  # Drops tables when tests are completed
  config.after(:all){
    TestDB.clean
  } 
  # Make sure every test is isolated.
  config.before(:each){
    ModelsHelper.models.each{|m| Object.send(:remove_const, m)}  
    load 'helpers/models_spec_helper.rb'
    FactoryGirl.reload
  }
    
end


Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
connection_manager-0.3.11 spec/spec_helper.rb
connection_manager-0.3.10 spec/spec_helper.rb
connection_manager-0.3.9 spec/spec_helper.rb
connection_manager-0.3.8 spec/spec_helper.rb
connection_manager-0.3.7 spec/spec_helper.rb
connection_manager-0.3.6 spec/spec_helper.rb
connection_manager-0.3.5 spec/spec_helper.rb
connection_manager-0.3.4 spec/spec_helper.rb
connection_manager-0.3.3 spec/spec_helper.rb
connection_manager-0.3.2 spec/spec_helper.rb
connection_manager-0.3.1 spec/spec_helper.rb
connection_manager-0.3.0 spec/spec_helper.rb