Sha256: b2f9c8221f54a680c56eae98a63af625cf03831c131fd8002c8892dbab5dd41a

Contents?: true

Size: 1.37 KB

Versions: 1

Compression:

Stored size: 1.37 KB

Contents

require 'bundler'
Bundler.setup

require 'activerecord-mysql-awesome'
require 'config'

require 'active_support/testing/autorun'
require 'stringio'

require 'active_record'
require 'cases/test_case'
require 'active_support/dependencies'
require 'active_support/logger'
require 'active_support/core_ext/string/strip'

require 'support/config'
require 'support/connection'

# TODO: Move all these random hacks into the ARTest namespace and into the support/ dir

Thread.abort_on_exception = true

# Show backtraces for deprecated behavior for quicker cleanup.
ActiveSupport::Deprecation.debug = true

# Enable raise errors in after_commit and after_rollback.
ActiveRecord::Base.tap do |klass|
  klass.raise_in_transactional_callbacks = true if klass.respond_to?(:raise_in_transactional_callbacks=)
end

# Connect to the database
ARTest.connect

def current_adapter?(*types)
  types.any? do |type|
    ActiveRecord::ConnectionAdapters.const_defined?(type) &&
      ActiveRecord::Base.connection.is_a?(ActiveRecord::ConnectionAdapters.const_get(type))
  end
end

def mysql_56?
  current_adapter?(:Mysql2Adapter) && ActiveRecord::Base.connection.version >= "5.6.0"
end

# FIXME: we have tests that depend on run order, we should fix that and
# remove this method call.
require 'active_support/test_case'
ActiveSupport::TestCase.tap do |klass|
  klass.test_order = :sorted if klass.respond_to?(:test_order=)
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
activerecord-mysql-awesome-0.0.9 test/cases/helper.rb