Sha256: 8d6834bde7c49dd88e982e9cad5f867eaf9a686b2659739fd54ae8c6b679ca0e

Contents?: true

Size: 1.01 KB

Versions: 20

Compression:

Stored size: 1.01 KB

Contents

# Configure Rails Environment
ENV["RAILS_ENV"] = "test"

puts "TRYING TO USE DB: #{ENV['DB'] || 'default'}"

require File.expand_path("../../test/dummy/config/environment.rb",  __FILE__)
ActiveRecord::Migrator.migrations_paths = [File.expand_path("../../test/dummy/db/migrate", __FILE__)]
ActiveRecord::Migrator.migrations_paths << File.expand_path('../../db/migrate', __FILE__)
require "rails/test_help"

ActiveSupport::TestCase.use_transactional_fixtures = false

puts "USING DB: #{RailsDb::Database.adapter.adapter_name}"

# Filter out Minitest backtrace while allowing backtrace from other libraries
# to be shown.
Minitest.backtrace_filter = Minitest::BacktraceFilter.new

# Load support files
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }

def clean_db
  if ActiveRecord::Base.connection.table_exists? :t
    ActiveRecord::Base.connection.drop_table :t
  end
  ActiveRecord::Base.connection.tables.map(&:classify).map{|name| name.constantize if Object.const_defined?(name)}.compact.each(&:delete_all)
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
rails_db-1.4.0 test/test_helper.rb
rails_db-1.3.4 test/test_helper.rb
rails_db-1.3.3 test/test_helper.rb
rails_db-1.3.2 test/test_helper.rb
rails_db-1.3.1 test/test_helper.rb
rails_db-1.3 test/test_helper.rb
rails_db-1.1.1 test/test_helper.rb
rails_db-1.1 test/test_helper.rb
rails_db-1.0 test/test_helper.rb
rails_db-0.9.9 test/test_helper.rb
rails_db-0.9 test/test_helper.rb
rails_db-0.8 test/test_helper.rb
rails_db-0.7.2 test/test_helper.rb
rails_db-0.7.1 test/test_helper.rb
rails_db-0.7 test/test_helper.rb
rails_db-0.6 test/test_helper.rb
rails_db-0.5.1 test/test_helper.rb
rails_db-0.5 test/test_helper.rb
rails_db-0.4 test/test_helper.rb
rails_db-0.3 test/test_helper.rb