Sha256: 9ca9dcf6608956cef0d6388e13e75c3d005c9c1bf3d69d1c79dd4ff15f6ca042

Contents?: true

Size: 1.26 KB

Versions: 3

Compression:

Stored size: 1.26 KB

Contents

# Make sure our default RAILS_ROOT from the helper plugin is in the load path
HELPER_RAILS_ROOT = "#{File.dirname(__FILE__)}/../generators/plugin_test_structure/templates/app_root" unless defined?(HELPER_RAILS_ROOT)
$:.unshift(HELPER_RAILS_ROOT)

# Determine the plugin's root test directory and add it to the load path
RAILS_ROOT = (File.directory?('./test/app_root') ? './test/app_root' : HELPER_RAILS_ROOT) unless defined?(RAILS_ROOT)
$:.unshift(RAILS_ROOT)

# Set the default environment to sqlite3's in_memory database
ENV['RAILS_ENV'] ||= 'in_memory'

# First boot the Rails framework
require 'config/boot'

# Extend it so that we can hook into the initialization process
require 'plugin_test_helper/extensions/initializer'

# Load the Rails environment and testing framework
require 'config/environment'
require 'test_help'

# Load additional test classes not done automatically by < Rails 2.2.2
# TODO: Remove in Rails 2.2.3 / 2.3 (whichever includes the fix)
require 'action_view/test_case'

# Undo changes to RAILS_ENV
silence_warnings {RAILS_ENV = ENV['RAILS_ENV']}

# Set default fixture loading properties
Test::Unit::TestCase.class_eval do
  self.use_transactional_fixtures = true
  self.use_instantiated_fixtures = false
  self.fixture_path = "#{Rails.root}/../fixtures"
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
plugin_test_helper-0.1.6 lib/plugin_test_helper.rb
plugin_test_helper-0.2.0 lib/plugin_test_helper.rb
plugin_test_helper-0.2.1 lib/plugin_test_helper.rb