aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test/isolation
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2016-02-10 01:31:00 +0100
committerXavier Noria <fxn@hashref.com>2016-02-10 01:32:17 +0100
commitbd6971812434e6f016977dc5c39fbc6450433471 (patch)
tree5e019c6ad6931bdbdf8119483464e118bf073bb0 /railties/test/isolation
parent00a5eb6aeb1277472da5fe9e7dd02d003c766b13 (diff)
downloadrails-bd6971812434e6f016977dc5c39fbc6450433471.tar.gz
rails-bd6971812434e6f016977dc5c39fbc6450433471.tar.bz2
rails-bd6971812434e6f016977dc5c39fbc6450433471.zip
prevent apps in the railties test suite from running the evented monitor
Diffstat (limited to 'railties/test/isolation')
-rw-r--r--railties/test/isolation/abstract_unit.rb15
1 files changed, 12 insertions, 3 deletions
diff --git a/railties/test/isolation/abstract_unit.rb b/railties/test/isolation/abstract_unit.rb
index dddf8bd257..e7a261fa1f 100644
--- a/railties/test/isolation/abstract_unit.rb
+++ b/railties/test/isolation/abstract_unit.rb
@@ -154,6 +154,8 @@ module TestHelpers
config.action_controller.allow_forgery_protection = false
config.log_level = :info
RUBY
+
+ remove_from_env_config('development', 'config.file_watcher.*')
end
def teardown_app
@@ -272,10 +274,17 @@ module TestHelpers
end
def remove_from_config(str)
- file = "#{app_path}/config/application.rb"
+ remove_from_file("#{app_path}/config/application.rb", str)
+ end
+
+ def remove_from_env_config(env, str)
+ remove_from_file("#{app_path}/config/environments/#{env}.rb", str)
+ end
+
+ def remove_from_file(file, str)
contents = File.read(file)
- contents.sub!(/#{str}/, "")
- File.open(file, "w+") { |f| f.puts contents }
+ contents.sub!(/#{str}/, '')
+ File.write(file, contents)
end
def app_file(path, contents, mode = 'w')