Sha256: 43abb8033207b384a737d036f73bc36213579f5a8306a9f8a3614d8d78d1315e

Contents?: true

Size: 1.39 KB

Versions: 1

Compression:

Stored size: 1.39 KB

Contents

require 'bundler'
Bundler.setup

require 'activerecord-mysql-comment'
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.send(:version).join(".") >= "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-comment-0.0.1 test/cases/helper.rb