aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test/generators
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2016-02-10 00:18:25 +0100
committerXavier Noria <fxn@hashref.com>2016-02-10 00:28:50 +0100
commitde6ad5665d2679944a9ee9407826ba88395a1003 (patch)
treead381fa08493b55d485fcd68d97fcdd7018074b3 /railties/test/generators
parentb5eb2423b6e431ba53e3836d58449e7e810096b4 (diff)
downloadrails-de6ad5665d2679944a9ee9407826ba88395a1003.tar.gz
rails-de6ad5665d2679944a9ee9407826ba88395a1003.tar.bz2
rails-de6ad5665d2679944a9ee9407826ba88395a1003.zip
enables the evented monitor in new applications
Diffstat (limited to 'railties/test/generators')
-rw-r--r--railties/test/generators/app_generator_test.rb22
1 files changed, 22 insertions, 0 deletions
diff --git a/railties/test/generators/app_generator_test.rb b/railties/test/generators/app_generator_test.rb
index f483a0bcbd..f4d0b15546 100644
--- a/railties/test/generators/app_generator_test.rb
+++ b/railties/test/generators/app_generator_test.rb
@@ -479,6 +479,28 @@ class AppGeneratorTest < Rails::Generators::TestCase
end
end
+ def test_inclusion_of_listen_related_gems
+ run_generator
+ if RbConfig::CONFIG['host_os'] =~ /darwin|linux/
+ assert_gem 'listen'
+ else
+ assert_file 'Gemfile' do |content|
+ assert_no_match(/listen/, content)
+ end
+ end
+ end
+
+ def test_evented_file_update_checker_config
+ run_generator
+ assert_file 'config/environments/development.rb' do |content|
+ if RbConfig::CONFIG['host_os'] =~ /darwin|linux/
+ assert_match(/^\s*config.file_watcher = ActiveSupport::EventedFileUpdateChecker/, content)
+ else
+ assert_match(/^\s*# config.file_watcher = ActiveSupport::EventedFileUpdateChecker/, content)
+ end
+ end
+ end
+
def test_template_from_dir_pwd
FileUtils.cd(Rails.root)
assert_match(/It works from file!/, run_generator([destination_root, "-m", "lib/template.rb"]))