diff options
author | Emilio Tagua <miloops@gmail.com> | 2010-11-18 16:07:23 -0300 |
---|---|---|
committer | Emilio Tagua <miloops@gmail.com> | 2010-11-19 19:09:00 -0300 |
commit | 375aaa9db1bb808f9126e3a057c80fca0c631ba6 (patch) | |
tree | 671e32c5d50d4948d99b4c48bd0a01c3ea72e3a4 /railties/test/isolation | |
parent | d47224190cdb309cdc042876b8fd4b9378b8fe30 (diff) | |
download | rails-375aaa9db1bb808f9126e3a057c80fca0c631ba6.tar.gz rails-375aaa9db1bb808f9126e3a057c80fca0c631ba6.tar.bz2 rails-375aaa9db1bb808f9126e3a057c80fca0c631ba6.zip |
Enable IdentityMap when generating new apps.
Diffstat (limited to 'railties/test/isolation')
-rw-r--r-- | railties/test/isolation/abstract_unit.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/railties/test/isolation/abstract_unit.rb b/railties/test/isolation/abstract_unit.rb index 3b03e4eb3d..3a582f850f 100644 --- a/railties/test/isolation/abstract_unit.rb +++ b/railties/test/isolation/abstract_unit.rb @@ -215,6 +215,17 @@ module TestHelpers end end + def remove_from_config(str) + application_file = "#{app_path}/config/application.rb" + environment = File.read(application_file) + lines = File.readlines(application_file) + if environment =~ /(\n\s*end\s*end\s*)\Z/ + File.open(application_file, 'w') do |f| + lines.each {|line| f.puts(line) unless line =~ /#{str}/ } + end + end + end + def app_file(path, contents) FileUtils.mkdir_p File.dirname("#{app_path}/#{path}") File.open("#{app_path}/#{path}", 'w') do |f| @@ -231,6 +242,7 @@ module TestHelpers :activemodel, :activerecord, :activeresource] - arr + remove_from_config "config.active_record" if to_remove.include? :activerecord $:.reject! {|path| path =~ %r'/(#{to_remove.join('|')})/' } end |