aboutsummaryrefslogtreecommitdiffstats
path: root/railties
diff options
context:
space:
mode:
authorFrancesco Rodriguez <lrodriguezsanc@gmail.com>2012-07-03 11:58:17 -0500
committerFrancesco Rodriguez <lrodriguezsanc@gmail.com>2012-07-03 11:58:17 -0500
commit1c5722cdf675fce6c7f69bfb5ca773ce3db8fe19 (patch)
tree435293d32d60d8e7e36271a2bbfb8ef517eea281 /railties
parenta967487cbd7760a7108edd2328b18c137edc1d6d (diff)
downloadrails-1c5722cdf675fce6c7f69bfb5ca773ce3db8fe19.tar.gz
rails-1c5722cdf675fce6c7f69bfb5ca773ce3db8fe19.tar.bz2
rails-1c5722cdf675fce6c7f69bfb5ca773ce3db8fe19.zip
remove test/dummy from gitignore when "plugin new -T"
Diffstat (limited to 'railties')
-rw-r--r--railties/lib/rails/generators/rails/plugin_new/templates/gitignore2
-rw-r--r--railties/test/generators/plugin_new_generator_test.rb8
2 files changed, 9 insertions, 1 deletions
diff --git a/railties/lib/rails/generators/rails/plugin_new/templates/gitignore b/railties/lib/rails/generators/rails/plugin_new/templates/gitignore
index 458b2c662e..086d87818a 100644
--- a/railties/lib/rails/generators/rails/plugin_new/templates/gitignore
+++ b/railties/lib/rails/generators/rails/plugin_new/templates/gitignore
@@ -1,8 +1,10 @@
.bundle/
log/*.log
pkg/
+<% unless options[:skip_test_unit] && options[:dummy_path] == 'test/dummy' -%>
<%= dummy_path %>/db/*.sqlite3
<%= dummy_path %>/db/*.sqlite3-journal
<%= dummy_path %>/log/*.log
<%= dummy_path %>/tmp/
<%= dummy_path %>/.sass-cache
+<% end -%> \ No newline at end of file
diff --git a/railties/test/generators/plugin_new_generator_test.rb b/railties/test/generators/plugin_new_generator_test.rb
index 0a235b56d5..6c3e0178f2 100644
--- a/railties/test/generators/plugin_new_generator_test.rb
+++ b/railties/test/generators/plugin_new_generator_test.rb
@@ -264,11 +264,14 @@ class PluginNewGeneratorTest < Rails::Generators::TestCase
assert_file "spec/dummy"
assert_file "spec/dummy/config/application.rb"
assert_no_file "test"
+ assert_file '.gitignore' do |contents|
+ assert_match(/spec\/dummy/, contents)
+ end
end
def test_ensure_that_gitignore_can_be_generated_from_a_template_for_dummy_path
FileUtils.cd(Rails.root)
- run_generator([destination_root, "--dummy_path", "spec/dummy" "--skip-test-unit"])
+ run_generator([destination_root, "--dummy_path", "spec/dummy", "--skip-test-unit"])
assert_file ".gitignore" do |contents|
assert_match(/spec\/dummy/, contents)
end
@@ -280,6 +283,9 @@ class PluginNewGeneratorTest < Rails::Generators::TestCase
assert_file "bukkits.gemspec" do |contents|
assert_no_match(/s.test_files = Dir\["test\/\*\*\/\*"\]/, contents)
end
+ assert_file '.gitignore' do |contents|
+ assert_no_match(/test\dummy/, contents)
+ end
end
def test_skipping_gemspec