diff options
-rw-r--r-- | railties/test/isolation/abstract_unit.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/railties/test/isolation/abstract_unit.rb b/railties/test/isolation/abstract_unit.rb index 462a4d8dea..0b479e944c 100644 --- a/railties/test/isolation/abstract_unit.rb +++ b/railties/test/isolation/abstract_unit.rb @@ -157,9 +157,13 @@ Module.new do FileUtils.mkdir(tmp_path) environment = File.expand_path('../../../../vendor/gems/environment', __FILE__) + if File.exist?(environment) + require_environment = "-r #{environment}" + end - `#{Gem.ruby} -r #{environment} #{RAILS_FRAMEWORK_ROOT}/railties/bin/rails #{tmp_path('app_template')}` + `#{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}' ; require 'rails'" + f.puts "require '#{environment}'" if require_environment + f.puts "require 'rails'" end end |