Sha256: d0e0a2d87f00dc3da2958f01b3d6d520b515673d0a476264bd1af4d7d8f9eb23

Contents?: true

Size: 897 Bytes

Versions: 1

Compression:

Stored size: 897 Bytes

Contents

# Load the environment
ENV['DB'] ||= 'in_memory'
require File.dirname(__FILE__) + '/app_root/config/environment.rb'

# Load the testing framework
require 'test/unit'
require 'active_record/fixtures'

# Load the plugin
$:.unshift(File.dirname(__FILE__) + '/../lib')
require File.dirname(__FILE__) + '/../init'

# Run the migrations
ActiveRecord::Migrator.migrate("#{APP_ROOT}/db/migrate")

# Load fixtures
Test::Unit::TestCase.fixture_path = "#{APP_ROOT}/test/fixtures/"
$LOAD_PATH.unshift(Test::Unit::TestCase.fixture_path)

class Test::Unit::TestCase #:nodoc:
  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
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
polymorphic_identity-0.0.1 test/test_helper.rb