Sha256: 5f8b2f2f5db55dbeeaa3f9773869877891dad8c584bad3e3e5a950c0ba9fa0f0

Contents?: true

Size: 1.8 KB

Versions: 2

Compression:

Stored size: 1.8 KB

Contents

require 'rubygems'

require 'bundler'
Bundler.setup
# shoulda-matchers dependency:
require 'active_support/core_ext/module/delegation'
Bundler.require(:default, :development)

if defined?(Debugger)
  ::Debugger.start
  ::Debugger.settings[:autoeval] = true if ::Debugger.respond_to?(:settings)
end

require 'test/unit'
require 'mocha'
require 'active_record'
require "logger"

raise "Must configure #time_zone_aware_attributes prior to models" if defined?(Post)
ENV['TZ'] = 'utc'
ActiveRecord::Base.time_zone_aware_attributes = true
ActiveRecord::Base.logger = Logger.new(StringIO.new)

require 'active_record/fixtures'

$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
$LOAD_PATH.unshift(File.dirname(__FILE__))
require 'kasket'

Kasket.setup

class ActiveSupport::TestCase
  include ActiveRecord::TestFixtures

  def create_fixtures(*table_names)
    if block_given?
      Fixtures.create_fixtures(Test::Unit::TestCase.fixture_path, table_names) { yield }
    else
      Fixtures.create_fixtures(Test::Unit::TestCase.fixture_path, table_names)
    end
  end

  self.use_transactional_fixtures = true

  self.use_instantiated_fixtures  = false

  setup :clear_cache
  def clear_cache
    Kasket.cache.clear
  end

  def arel?
    self.class.arel?
  end

  def self.arel?
    ActiveRecord::VERSION::MAJOR >= 3 && ActiveRecord::VERSION::MINOR >= 1
  end
end

ActiveSupport::TestCase.fixture_path = File.dirname(__FILE__) + "/fixtures/"
$LOAD_PATH.unshift(ActiveSupport::TestCase.fixture_path)

class ActiveSupport::TestCase
  fixtures :all
end

module Rails
  module_function
  CACHE = ActiveSupport::Cache::MemoryStore.new
  LOGGER = Logger.new(STDOUT)

  def cache
    CACHE
  end

  def logger
    LOGGER
  end
end

require 'test_models'
POST_VERSION = Post.column_names.join.sum
COMMENT_VERSION = Comment.column_names.join.sum

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
kasket-3.1.5 test/helper.rb
kasket-3.1.4 test/helper.rb