Sha256: 9df34bd99dfe85f07827f811bcc95b42d98d17e0596ed37977bd7f7e77cfafc1

Contents?: true

Size: 1.36 KB

Versions: 19

Compression:

Stored size: 1.36 KB

Contents

require_relative "../sequel_warning"

$:.unshift(File.join(File.dirname(File.expand_path(__FILE__)), "../../lib/"))
require_relative "../../lib/sequel"

Sequel::Deprecation.backtrace_filter = lambda{|line, lineno| lineno < 4 || line =~ /_spec\.rb/}

ENV['MT_NO_PLUGINS'] = '1' # Work around stupid autoloading of plugins
gem 'minitest'
require 'minitest/autorun'
require 'minitest/hooks/default'

require_relative '../deprecation_helper'

class << Sequel::Model
  attr_writer :db_schema
  alias orig_columns columns
  def columns(*cols)
    return super if cols.empty?
    define_method(:columns){cols}
    @dataset.send(:columns=, cols) if @dataset
    def_column_accessor(*cols)
    @columns = cols
    @db_schema = {}
    cols.each{|c| @db_schema[c] = {}}
  end
end

Sequel::DB = nil
Sequel::Model.use_transactions = false
Sequel::Model.cache_anonymous_models = false

db = Sequel.mock(:fetch=>{:id => 1, :x => 1}, :numrows=>1, :autoid=>proc{|sql| 10})
def db.schema(*) [[:id, {:primary_key=>true}]] end
def db.reset() sqls end
def db.supports_schema_parsing?() true end
Sequel::Model.db = DB = db

if ENV['SEQUEL_COLUMNS_INTROSPECTION']
  Sequel.extension :columns_introspection
  Sequel::Database.extension :columns_introspection
  Sequel::Mock::Dataset.send(:include, Sequel::ColumnsIntrospection)
end
if ENV['SEQUEL_NO_CACHE_ASSOCIATIONS']
  Sequel::Model.cache_associations = false
end

Version data entries

19 entries across 18 versions & 2 rubygems

Version Path
sequel-5.24.0 spec/model/spec_helper.rb
sequel-5.23.0 spec/model/spec_helper.rb
sequel-5.22.0 spec/model/spec_helper.rb
sequel-5.21.0 spec/model/spec_helper.rb
sequel-5.20.0 spec/model/spec_helper.rb
tdiary-5.0.13 vendor/bundle/gems/sequel-5.18.0/spec/model/spec_helper.rb
sequel-5.19.0 spec/model/spec_helper.rb
tdiary-5.0.12.1 vendor/bundle/gems/sequel-5.18.0/spec/model/spec_helper.rb
sequel-5.18.0 spec/model/spec_helper.rb
sequel-5.17.0 spec/model/spec_helper.rb
sequel-5.16.0 spec/model/spec_helper.rb
tdiary-5.0.11 vendor/bundle/gems/sequel-5.15.0/spec/model/spec_helper.rb
tdiary-5.0.11 vendor/bundle/gems/sequel-5.11.0/spec/model/spec_helper.rb
sequel-5.15.0 spec/model/spec_helper.rb
sequel-5.14.0 spec/model/spec_helper.rb
sequel-5.13.0 spec/model/spec_helper.rb
sequel-5.12.0 spec/model/spec_helper.rb
sequel-5.11.0 spec/model/spec_helper.rb
sequel-5.10.0 spec/model/spec_helper.rb