aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test/generators/app_generator_test.rb
diff options
context:
space:
mode:
authorYoong Kang Lim <yoongkang.lim@gmail.com>2015-05-26 21:52:10 +1000
committerGodfrey Chan <godfreykfc@gmail.com>2015-05-30 00:44:12 -0700
commitf06ce4c12a396795a3b2c1812951d9277bcb3a82 (patch)
treebbebbb70cfe0b71deacd3347aa67517102e88aab /railties/test/generators/app_generator_test.rb
parent6fc83f8efeb1637af5d17b0d7b0c4b2e3db3c001 (diff)
downloadrails-f06ce4c12a396795a3b2c1812951d9277bcb3a82.tar.gz
rails-f06ce4c12a396795a3b2c1812951d9277bcb3a82.tar.bz2
rails-f06ce4c12a396795a3b2c1812951d9277bcb3a82.zip
Generate a `.keep` file in `tmp` folder
A lot of scripts assumes the existence of this folder and most would fail if it is absent. One example of this is `rake restart` (before the previous commit) – it tries to `touch tmp/restart.txt`, which would fail if `tmp` does not exist, which was the case for a freshly-cloned project as `tmp` is `.gitignored` by default. See #20299. [Yoong Kang Lim, Sunny Juneja]
Diffstat (limited to 'railties/test/generators/app_generator_test.rb')
-rw-r--r--railties/test/generators/app_generator_test.rb27
1 files changed, 27 insertions, 0 deletions
diff --git a/railties/test/generators/app_generator_test.rb b/railties/test/generators/app_generator_test.rb
index 2bfa05a0b8..af1c05cab1 100644
--- a/railties/test/generators/app_generator_test.rb
+++ b/railties/test/generators/app_generator_test.rb
@@ -44,6 +44,7 @@ DEFAULT_APP_FILES = %w(
vendor/assets
vendor/assets/stylesheets
vendor/assets/javascripts
+ tmp
tmp/cache
tmp/cache/assets
)
@@ -606,6 +607,32 @@ class AppGeneratorTest < Rails::Generators::TestCase
end
end
+ def test_create_keeps
+ run_generator
+ folders_with_keep = %w(
+ app/assets/images
+ app/mailers
+ app/models
+ app/controllers/concerns
+ app/models/concerns
+ lib/tasks
+ lib/assets
+ log
+ test/fixtures
+ test/fixtures/files
+ test/controllers
+ test/mailers
+ test/models
+ test/helpers
+ test/integration
+ tmp
+ vendor/assets/stylesheets
+ )
+ folders_with_keep.each do |folder|
+ assert_file("#{folder}/.keep")
+ end
+ end
+
def test_psych_gem
run_generator
gem_regex = /gem 'psych',\s+'~> 2.0',\s+platforms: :rbx/