diff options
author | Joshua Peek <josh@joshpeek.com> | 2009-11-09 22:36:30 -0600 |
---|---|---|
committer | Joshua Peek <josh@joshpeek.com> | 2009-11-09 22:36:30 -0600 |
commit | 335c0e62cd1e809a79e209977a62dba2e583cb88 (patch) | |
tree | 5d291de2c1a91e3e3d3637a43608c26d10e1520b | |
parent | f03bcf249527ba4945fdce673bae971a9ac11bb7 (diff) | |
download | rails-335c0e62cd1e809a79e209977a62dba2e583cb88.tar.gz rails-335c0e62cd1e809a79e209977a62dba2e583cb88.tar.bz2 rails-335c0e62cd1e809a79e209977a62dba2e583cb88.zip |
Fix railties isolated tests if bundler environment doesn't exist
-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 |