Skip to content

Commit

Permalink
prevent apps in the railties test suite from running the evented monitor
Browse files Browse the repository at this point in the history
  • Loading branch information
fxn committed Feb 10, 2016
1 parent 00a5eb6 commit bd69718
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions railties/test/isolation/abstract_unit.rb
Expand Up @@ -154,6 +154,8 @@ def build_app(options = {})
config.action_controller.allow_forgery_protection = false
config.log_level = :info
RUBY

remove_from_env_config('development', 'config.file_watcher.*')
end

def teardown_app
Expand Down Expand Up @@ -272,10 +274,17 @@ def add_to_env_config(env, str)
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')
Expand Down

0 comments on commit bd69718

Please sign in to comment.