aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test/isolation
diff options
context:
space:
mode:
authorCarl Lerche <carllerche@mac.com>2010-01-31 16:33:06 -0800
committerCarl Lerche <carllerche@mac.com>2010-01-31 19:13:43 -0800
commit9f01dff9c203821bf4ac6d7b885f1d6b018d5c79 (patch)
tree5e7c4be2aec0f7e2bff6eac4e066a16dc4e269ad /railties/test/isolation
parent9bd0422dd7b4fc9f3bebf6301b144c6a5f35c26b (diff)
downloadrails-9f01dff9c203821bf4ac6d7b885f1d6b018d5c79.tar.gz
rails-9f01dff9c203821bf4ac6d7b885f1d6b018d5c79.tar.bz2
rails-9f01dff9c203821bf4ac6d7b885f1d6b018d5c79.zip
Get rails tests running on bundler 0.9
Diffstat (limited to 'railties/test/isolation')
-rw-r--r--railties/test/isolation/abstract_unit.rb26
1 files changed, 7 insertions, 19 deletions
diff --git a/railties/test/isolation/abstract_unit.rb b/railties/test/isolation/abstract_unit.rb
index 940585836c..ff4ee6332b 100644
--- a/railties/test/isolation/abstract_unit.rb
+++ b/railties/test/isolation/abstract_unit.rb
@@ -183,23 +183,7 @@ module TestHelpers
end
def boot_rails
- root = File.expand_path('../../../..', __FILE__)
- begin
- require "#{root}/vendor/gems/environment"
- rescue LoadError
- %w(
- actionmailer/lib
- actionpack/lib
- activemodel/lib
- activerecord/lib
- activeresource/lib
- activesupport/lib
- railties/lib
- railties
- ).reverse_each do |path|
- $:.unshift "#{root}/#{path}"
- end
- end
+ require File.expand_path('../../../../load_paths', __FILE__)
end
end
end
@@ -220,14 +204,18 @@ Module.new do
end
FileUtils.mkdir(tmp_path)
- environment = File.expand_path('../../../../vendor/gems/environment', __FILE__)
+ environment = File.expand_path('../../../../load_paths', __FILE__)
if File.exist?("#{environment}.rb")
require_environment = "-r #{environment}"
end
`#{Gem.ruby} #{require_environment} #{RAILS_FRAMEWORK_ROOT}/railties/bin/rails #{tmp_path('app_template')}`
File.open("#{tmp_path}/app_template/config/boot.rb", 'w') do |f|
- f.puts "require '#{environment}'" if require_environment
+ if require_environment
+ f.puts "Dir.chdir('#{File.dirname(environment)}') do"
+ f.puts " require '#{environment}'"
+ f.puts "end"
+ end
f.puts "require 'rails/all'"
end
end