Fixed error with 'rails generate new plugin' where the .gitignore was not properly generated if --dummy-path was used and added test case

This commit is contained in:
Tyler Coville
2011-11-09 23:22:26 -08:00
parent a625523e75
commit 49349089ad
3 changed files with 12 additions and 4 deletions

View File

@@ -39,7 +39,7 @@ module Rails
end
def gitignore
copy_file "gitignore", ".gitignore"
template "gitignore", ".gitignore"
end
def lib

View File

@@ -1,6 +1,6 @@
.bundle/
log/*.log
pkg/
test/dummy/db/*.sqlite3
test/dummy/log/*.log
test/dummy/tmp/
<%= dummy_path %>/db/*.sqlite3
<%= dummy_path %>/log/*.log
<%= dummy_path %>/tmp/

View File

@@ -236,6 +236,14 @@ class PluginNewGeneratorTest < Rails::Generators::TestCase
assert_file "spec/dummy/config/application.rb"
assert_no_file "test"
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"])
assert_file ".gitignore" do |contents|
assert_match(/spec\/dummy/, contents)
end
end
def test_skipping_test_unit
run_generator [destination_root, "--skip-test-unit"]