Skip to content
This repository
Browse code

remove test/dummy from gitignore when "plugin new -T"

  • Loading branch information...
commit 1c5722cdf675fce6c7f69bfb5ca773ce3db8fe19 1 parent a967487
Francesco Rodríguez authored July 03, 2012
2  railties/lib/rails/generators/rails/plugin_new/templates/gitignore
... ...
@@ -1,8 +1,10 @@
1 1
 .bundle/
2 2
 log/*.log
3 3
 pkg/
  4
+<% unless options[:skip_test_unit] && options[:dummy_path] == 'test/dummy' -%>
4 5
 <%= dummy_path %>/db/*.sqlite3
5 6
 <%= dummy_path %>/db/*.sqlite3-journal
6 7
 <%= dummy_path %>/log/*.log
7 8
 <%= dummy_path %>/tmp/
8 9
 <%= dummy_path %>/.sass-cache
  10
+<% end -%>
8  railties/test/generators/plugin_new_generator_test.rb
@@ -264,11 +264,14 @@ def test_creating_dummy_without_tests_but_with_dummy_path
264 264
     assert_file "spec/dummy"
265 265
     assert_file "spec/dummy/config/application.rb"
266 266
     assert_no_file "test"
  267
+    assert_file '.gitignore' do |contents|
  268
+      assert_match(/spec\/dummy/, contents)
  269
+    end
267 270
   end
268 271
 
269 272
   def test_ensure_that_gitignore_can_be_generated_from_a_template_for_dummy_path
270 273
     FileUtils.cd(Rails.root)
271  
-    run_generator([destination_root, "--dummy_path", "spec/dummy" "--skip-test-unit"])
  274
+    run_generator([destination_root, "--dummy_path", "spec/dummy", "--skip-test-unit"])
272 275
     assert_file ".gitignore" do |contents|
273 276
       assert_match(/spec\/dummy/, contents)
274 277
     end
@@ -280,6 +283,9 @@ def test_skipping_test_unit
280 283
     assert_file "bukkits.gemspec" do |contents|
281 284
       assert_no_match(/s.test_files = Dir\["test\/\*\*\/\*"\]/, contents)
282 285
     end
  286
+    assert_file '.gitignore' do |contents|
  287
+      assert_no_match(/test\dummy/, contents)
  288
+    end
283 289
   end
284 290
 
285 291
   def test_skipping_gemspec

0 notes on commit 1c5722c

Please sign in to comment.
Something went wrong with that request. Please try again.