diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2014-11-04 14:14:03 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2014-11-04 14:14:03 -0800 |
commit | 0d5a384498296f005395d02943bd18e688aba436 (patch) | |
tree | 95f947591e9788d9582c1eb10c85164be4338732 /railties/test/isolation | |
parent | 11370eea81ca3b7b9d79264c0a4517c961d45bf6 (diff) | |
download | rails-0d5a384498296f005395d02943bd18e688aba436.tar.gz rails-0d5a384498296f005395d02943bd18e688aba436.tar.bz2 rails-0d5a384498296f005395d02943bd18e688aba436.zip |
add a test for #17106
Diffstat (limited to 'railties/test/isolation')
-rw-r--r-- | railties/test/isolation/abstract_unit.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/railties/test/isolation/abstract_unit.rb b/railties/test/isolation/abstract_unit.rb index 40469e31d7..bf2992005b 100644 --- a/railties/test/isolation/abstract_unit.rb +++ b/railties/test/isolation/abstract_unit.rb @@ -231,6 +231,15 @@ module TestHelpers end end + def add_to_top_of_config(str) + environment = File.read("#{app_path}/config/application.rb") + if environment =~ /(Rails::Application\s*)/ + File.open("#{app_path}/config/application.rb", 'w') do |f| + f.puts $` + $1 + "\n#{str}\n" + $' + end + end + end + def add_to_config(str) environment = File.read("#{app_path}/config/application.rb") if environment =~ /(\n\s*end\s*end\s*)\Z/ |