Skip to content
This repository
Browse code

Merge pull request #3591 from tylercoville/fix-plugin-new

Fixed error with 'rails generate new plugin' where the .gitignore was not
  • Loading branch information...
commit 909e5cc32d0bd47dad2f5c5404670a074a9dabbd 2 parents c778f4e + 4934908
José Valim josevalim authored
2  railties/lib/rails/generators/rails/plugin_new/plugin_new_generator.rb
@@ -39,7 +39,7 @@ def gemspec
39 39 end
40 40
41 41 def gitignore
42   - copy_file "gitignore", ".gitignore"
  42 + template "gitignore", ".gitignore"
43 43 end
44 44
45 45 def lib
6 railties/lib/rails/generators/rails/plugin_new/templates/gitignore
... ... @@ -1,6 +1,6 @@
1 1 .bundle/
2 2 log/*.log
3 3 pkg/
4   -test/dummy/db/*.sqlite3
5   -test/dummy/log/*.log
6   -test/dummy/tmp/
  4 +<%= dummy_path %>/db/*.sqlite3
  5 +<%= dummy_path %>/log/*.log
  6 +<%= dummy_path %>/tmp/
8 railties/test/generators/plugin_new_generator_test.rb
@@ -236,6 +236,14 @@ def test_creating_dummy_without_tests_but_with_dummy_path
236 236 assert_file "spec/dummy/config/application.rb"
237 237 assert_no_file "test"
238 238 end
  239 +
  240 + def test_ensure_that_gitignore_can_be_generated_from_a_template_for_dummy_path
  241 + FileUtils.cd(Rails.root)
  242 + run_generator([destination_root, "--dummy_path", "spec/dummy" "--skip-test-unit"])
  243 + assert_file ".gitignore" do |contents|
  244 + assert_match(/spec\/dummy/, contents)
  245 + end
  246 + end
239 247
240 248 def test_skipping_test_unit
241 249 run_generator [destination_root, "--skip-test-unit"]

0 comments on commit 909e5cc

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