aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test
diff options
context:
space:
mode:
authorDerek Prior <derekprior@gmail.com>2012-09-12 20:15:38 -0500
committerFrancesco Rodriguez <lrodriguezsanc@gmail.com>2012-09-12 20:36:00 -0500
commitceb05bd1b2f083c252980d4820346bc986c83e39 (patch)
treee190484f3bf982235294bd736208e59a551708f0 /railties/test
parente55c75d2d8c137a2482fb6464953801e69b6e335 (diff)
downloadrails-ceb05bd1b2f083c252980d4820346bc986c83e39.tar.gz
rails-ceb05bd1b2f083c252980d4820346bc986c83e39.tar.bz2
rails-ceb05bd1b2f083c252980d4820346bc986c83e39.zip
change app/plugin generators to be more SCM agnostic
Users of other SCM's can now generate rails apps that will add the "empty" directories to source control, but will not have a useless .gitignore or mis-named .gitkeep files. * Change `rails new` and `rails plugin new` generators to name the `.gitkeep` as `.keep` in a more SCM-agnostic way. * Change `--skip-git` option to only skip the `.gitignore` file and still generate the `.keep` files. * Add `--skip-keeps` option to skip the `.keep` files. It closes #2800.
Diffstat (limited to 'railties/test')
-rw-r--r--railties/test/generators/app_generator_test.rb8
-rw-r--r--railties/test/generators/shared_generator_tests.rb12
2 files changed, 16 insertions, 4 deletions
diff --git a/railties/test/generators/app_generator_test.rb b/railties/test/generators/app_generator_test.rb
index c294bfb238..3ceb8c22a0 100644
--- a/railties/test/generators/app_generator_test.rb
+++ b/railties/test/generators/app_generator_test.rb
@@ -250,10 +250,10 @@ class AppGeneratorTest < Rails::Generators::TestCase
end
def test_generator_if_skip_index_html_is_given
- run_generator [destination_root, "--skip-index-html"]
- assert_no_file "public/index.html"
- assert_no_file "app/assets/images/rails.png"
- assert_file "app/assets/images/.gitkeep"
+ run_generator [destination_root, '--skip-index-html']
+ assert_no_file 'public/index.html'
+ assert_no_file 'app/assets/images/rails.png'
+ assert_file 'app/assets/images/.keep'
end
def test_creation_of_a_test_directory
diff --git a/railties/test/generators/shared_generator_tests.rb b/railties/test/generators/shared_generator_tests.rb
index e78e67725d..a4bdfcf438 100644
--- a/railties/test/generators/shared_generator_tests.rb
+++ b/railties/test/generators/shared_generator_tests.rb
@@ -127,6 +127,18 @@ module SharedGeneratorTests
# generated.
assert_file 'Gemfile'
end
+
+ def test_skip_git
+ run_generator [destination_root, '--skip-git', '--full']
+ assert_no_file('.gitignore')
+ assert_file('app/mailers/.keep')
+ end
+
+ def test_skip_keeps
+ run_generator [destination_root, '--skip-keeps', '--full']
+ assert_file('.gitignore')
+ assert_no_file('app/mailers/.keep')
+ end
end
module SharedCustomGeneratorTests