1 # Don't change this file. Configuration is done in config/environment.rb and config/environments/*.rb
2 unless defined?(RAILS_ROOT)
3 root_path = File.join(File.dirname(__FILE__), '..')
5 unless RUBY_PLATFORM =~ /mswin32/
7 root_path = Pathname.new(root_path).cleanpath(true).to_s
10 RAILS_ROOT = root_path
13 ENV['RSPEC_RAILS_VERSION'] ||= "edge"
14 puts "running against rails #{ENV['RSPEC_RAILS_VERSION']}"
16 unless defined?(Rails::Initializer)
18 version_root = File.expand_path("#{RAILS_ROOT}/vendor/rails/#{ENV['RSPEC_RAILS_VERSION']}")
19 if File.directory?(version_root)
20 $LOAD_PATH.unshift "#{version_root}/actionpack/lib/"
21 $LOAD_PATH.unshift "#{version_root}/actionmailer/lib/"
22 $LOAD_PATH.unshift "#{version_root}/actionwebservice/lib/"
23 $LOAD_PATH.unshift "#{version_root}/activerecord/lib/"
24 $LOAD_PATH.unshift "#{version_root}/activeresource/lib/"
25 $LOAD_PATH.unshift "#{version_root}/activesupport/lib/"
26 $LOAD_PATH.unshift "#{version_root}/railties/lib/"
27 require "#{version_root}/railties/lib/initializer"
29 raise "Attempting to run against rails #{version_root} but no such directory exists"
33 Rails::Initializer.run(:set_load_path) do |config|
34 config.plugin_paths = File.expand_path("#{RAILS_ROOT}/../vendor/plugins")