aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test/isolation/abstract_unit.rb
diff options
context:
space:
mode:
Diffstat (limited to 'railties/test/isolation/abstract_unit.rb')
-rw-r--r--railties/test/isolation/abstract_unit.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/railties/test/isolation/abstract_unit.rb b/railties/test/isolation/abstract_unit.rb
index 3b03e4eb3d..c5b1cb9a80 100644
--- a/railties/test/isolation/abstract_unit.rb
+++ b/railties/test/isolation/abstract_unit.rb
@@ -215,6 +215,13 @@ module TestHelpers
end
end
+ def remove_from_config(str)
+ file = "#{app_path}/config/application.rb"
+ contents = File.read(file)
+ contents.sub!(/#{str}/, "")
+ File.open(file, "w+") { |f| f.puts contents }
+ end
+
def app_file(path, contents)
FileUtils.mkdir_p File.dirname("#{app_path}/#{path}")
File.open("#{app_path}/#{path}", 'w') do |f|
@@ -231,6 +238,7 @@ module TestHelpers
:activemodel,
:activerecord,
:activeresource] - arr
+ remove_from_config "config.active_record.identity_map = true" if to_remove.include? :activerecord
$:.reject! {|path| path =~ %r'/(#{to_remove.join('|')})/' }
end