Sha256: 97e2bae41abe31bc51561749faa9d49514af8dc8999f15aac092d5a13e0e8175

Contents?: true

Size: 1.89 KB

Versions: 5

Compression:

Stored size: 1.89 KB

Contents

require 'rubygems'
require 'logger'
require "#{File.dirname(File.dirname(__FILE__))}/sequel_warning.rb"

if ENV['COVERAGE']
  require File.join(File.dirname(File.expand_path(__FILE__)), "../sequel_coverage")
  SimpleCov.sequel_coverage(:group=>%r{lib/sequel/adapters})
end

unless Object.const_defined?('Sequel')
  $:.unshift(File.join(File.dirname(File.expand_path(__FILE__)), "../../lib/"))
  require 'sequel'
end
begin
  require File.join(File.dirname(File.dirname(File.expand_path(__FILE__))), 'spec_config.rb')
rescue LoadError
end

Sequel.split_symbols = false if ENV['SEQUEL_NO_SPLIT_SYMBOLS']
Sequel::Database.extension :duplicate_column_handler if ENV['SEQUEL_DUPLICATE_COLUMN_HANDLER']
Sequel::Database.extension :columns_introspection if ENV['SEQUEL_COLUMNS_INTROSPECTION']
Sequel::Model.cache_associations = false if ENV['SEQUEL_NO_CACHE_ASSOCIATIONS']
if ENV['SEQUEL_MODEL_PREPARED_STATEMENTS']
  Sequel::Model.plugin :prepared_statements
  Sequel::Model.plugin :prepared_statements_associations
end
Sequel.cache_anonymous_models = false

class Sequel::Database
  def log_duration(duration, message)
    log_info(message)
  end
end

require './spec/guards_helper'

class Minitest::HooksSpec
  def check_sqls
    yield unless ENV['SEQUEL_NO_CHECK_SQLS']
  end
  def self.check_sqls
    yield unless ENV['SEQUEL_NO_CHECK_SQLS']
  end
end

IDENTIFIER_MANGLING = !ENV['SEQUEL_NO_MANGLE'] unless defined?(IDENTIFIER_MANGLING)

unless defined?(DB)
  env_var = "SEQUEL_#{SEQUEL_ADAPTER_TEST.to_s.upcase}_URL"
  env_var = ENV.has_key?(env_var) ? env_var : 'SEQUEL_INTEGRATION_URL'
  opts = {}
  opts[:identifier_mangling] = false unless IDENTIFIER_MANGLING
  DB = Sequel.connect(ENV[env_var], opts)
  DB.extension(:freeze_datasets) if ENV['SEQUEL_FREEZE_DATASETS']
end

if dch = ENV['SEQUEL_DUPLICATE_COLUMNS_HANDLER']
  DB.extension :duplicate_columns_handler
  DB.opts[:on_duplicate_columns] = dch.to_sym unless dch.empty?
end

Version data entries

5 entries across 4 versions & 2 rubygems

Version Path
tdiary-5.0.5 vendor/bundle/gems/sequel-4.44.0/spec/adapters/spec_helper.rb
tdiary-5.0.5 vendor/bundle/gems/tdiary-5.0.4/vendor/bundle/gems/sequel-4.44.0/spec/adapters/spec_helper.rb
tdiary-5.0.4 vendor/bundle/gems/sequel-4.44.0/spec/adapters/spec_helper.rb
sequel-4.44.0 spec/adapters/spec_helper.rb
sequel-4.43.0 spec/adapters/spec_helper.rb