aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test/generators/app_generator_test.rb
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2016-02-18 10:47:47 -0800
committerAaron Patterson <aaron.patterson@gmail.com>2016-02-18 10:47:47 -0800
commitfb8d01f1ef7da0a3c8c0173d6c3da59afe9d1ca5 (patch)
tree258d75655ddcd9aacd2df0b74bb6c58404e3de9b /railties/test/generators/app_generator_test.rb
parente4c3225b2c9475ebfac474c7196dec2feb290e5a (diff)
parent3bd9fe1708018e4e82f5d836cc6e047d9d9b5b55 (diff)
downloadrails-fb8d01f1ef7da0a3c8c0173d6c3da59afe9d1ca5.tar.gz
rails-fb8d01f1ef7da0a3c8c0173d6c3da59afe9d1ca5.tar.bz2
rails-fb8d01f1ef7da0a3c8c0173d6c3da59afe9d1ca5.zip
Merge branch 'master' into treewip
* master: (27 commits) move digest cache on to the DetailsKey object remove object `hash` cache [ci skip] fix suggested change-replace 'an' with 'the in Rails engine guide' Missing documentation about hash algorithm option for MessageVerifier [ci skip] set `skip_listen` option to dummy appplication Fix the language in engines guide Add accidentally removed `#` [ci skip] fields_for_style needs to test for AC::Parameters Fix indentation for code block in changelog Remove accidentally duplicated change log title [ci skip] partially revert 69009f4473637a44ade26d954ef5ddea6ff903f2 Remove needless `case_insensitive_comparison` in mysql2 adapter modify to `error` also abort when specify fail fast option Implement ActionController::Parameters#inspect remove unused method Remove unused Journey code Add Action Cable CHANGELOG in release notes [ci skip] Show proper error message when a non-relation object is passed to AR::Relation#or Fix semantics of test names for finish option in batches_test Fix typo ... Conflicts: actionview/lib/action_view/digestor.rb
Diffstat (limited to 'railties/test/generators/app_generator_test.rb')
-rw-r--r--railties/test/generators/app_generator_test.rb33
1 files changed, 27 insertions, 6 deletions
diff --git a/railties/test/generators/app_generator_test.rb b/railties/test/generators/app_generator_test.rb
index be05e779ea..921a5b36b5 100644
--- a/railties/test/generators/app_generator_test.rb
+++ b/railties/test/generators/app_generator_test.rb
@@ -479,18 +479,20 @@ class AppGeneratorTest < Rails::Generators::TestCase
end
end
- def test_inclusion_of_listen_related_gems
+ def test_inclusion_of_listen_related_configuration_by_default
run_generator
if RbConfig::CONFIG['host_os'] =~ /darwin|linux/
- assert_gem 'listen'
- assert_gem 'spring-watcher-listen'
+ assert_listen_related_configuration
else
- assert_file 'Gemfile' do |content|
- assert_no_match(/listen/, content)
- end
+ assert_no_listen_related_configuration
end
end
+ def test_non_inclusion_of_listen_related_configuration_if_skip_listen
+ run_generator [destination_root, '--skip-listen']
+ assert_no_listen_related_configuration
+ end
+
def test_evented_file_update_checker_config
run_generator
assert_file 'config/environments/development.rb' do |content|
@@ -759,4 +761,23 @@ class AppGeneratorTest < Rails::Generators::TestCase
assert_file "Gemfile", /^\s*gem\s+["']#{gem}["']$*/
end
end
+
+ def assert_listen_related_configuration
+ assert_gem 'listen'
+ assert_gem 'spring-watcher-listen'
+
+ assert_file 'config/environments/development.rb' do |content|
+ assert_match(/^\s*config.file_watcher = ActiveSupport::EventedFileUpdateChecker/, content)
+ end
+ end
+
+ def assert_no_listen_related_configuration
+ assert_file 'Gemfile' do |content|
+ assert_no_match(/listen/, content)
+ end
+
+ assert_file 'config/environments/development.rb' do |content|
+ assert_match(/^\s*# config.file_watcher = ActiveSupport::EventedFileUpdateChecker/, content)
+ end
+ end
end