Sha256: 181d376afb1f8c219836755378b20382379d1842d8c863f6a23b98f2f2561a2e

Contents?: true

Size: 946 Bytes

Versions: 4

Compression:

Stored size: 946 Bytes

Contents

require 'bundler'
Bundler.require :development, :test

require 'active_support'
require 'active_support/core_ext/string'
require 'active_support/deprecation'
require 'activerecord-collection_cache_key'
require 'minitest/autorun'
require 'logger'

ActiveRecord::Base.logger = Logger.new('/dev/null')
ActiveRecord::Base.establish_connection adapter: 'sqlite3', database: ':memory:'
ActiveSupport::Deprecation.silenced = true

module CollectionCacheKey
  class TestCase < MiniTest::Spec
    before { setup_schema }

    def ar_nsec?
      !::ActiveRecord::VERSION::STRING.start_with? '3.2.'
    end

    private

    def setup_schema
      ::ActiveRecord::Base.class_eval do
        connection.instance_eval do
          create_table :test_models, force: true do |t|
            t.text :name
            t.text :notes
            t.timestamps
          end
        end
      end
    end

    class TestModel < ::ActiveRecord::Base
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
activerecord-collection_cache_key-0.1.3 test/test_helper.rb
activerecord-collection_cache_key-0.1.2 test/test_helper.rb
activerecord-collection_cache_key-0.1.1 test/test_helper.rb
activerecord-collection_cache_key-0.1.0 test/test_helper.rb