diff options
author | Stefan Sprenger <stefan.sprenger@dkd.de> | 2011-05-25 15:03:07 +0200 |
---|---|---|
committer | Stefan Sprenger <stefan.sprenger@dkd.de> | 2011-05-25 15:03:07 +0200 |
commit | 5cf934eab50cae0b375713a0af7b5f2a2904ff45 (patch) | |
tree | be1350eb939f1508c871385b3cd4b79aa3c34a8c | |
parent | 41eac9b3f6b4a38de3b4c38e5b8d9f0e6b3cb08a (diff) | |
download | rails-5cf934eab50cae0b375713a0af7b5f2a2904ff45.tar.gz rails-5cf934eab50cae0b375713a0af7b5f2a2904ff45.tar.bz2 rails-5cf934eab50cae0b375713a0af7b5f2a2904ff45.zip |
Add test files to engine's gemspec
-rw-r--r-- | railties/lib/rails/generators/rails/plugin_new/templates/%name%.gemspec | 3 | ||||
-rw-r--r-- | railties/test/generators/plugin_new_generator_test.rb | 7 |
2 files changed, 10 insertions, 0 deletions
diff --git a/railties/lib/rails/generators/rails/plugin_new/templates/%name%.gemspec b/railties/lib/rails/generators/rails/plugin_new/templates/%name%.gemspec index 15299ddb9f..56b06829d8 100644 --- a/railties/lib/rails/generators/rails/plugin_new/templates/%name%.gemspec +++ b/railties/lib/rails/generators/rails/plugin_new/templates/%name%.gemspec @@ -5,5 +5,8 @@ Gem::Specification.new do |s| s.summary = "Insert <%= camelized %> summary." s.description = "Insert <%= camelized %> description." s.files = Dir["{app,config,lib}/**/*"] + ["MIT-LICENSE", "Rakefile", "README.rdoc"] +<% unless options.skip_test_unit? -%> + s.test_files = Dir["test/**/*"] +<% end -%> s.version = "0.0.1" end diff --git a/railties/test/generators/plugin_new_generator_test.rb b/railties/test/generators/plugin_new_generator_test.rb index 1b01c9dbc1..05ce11a730 100644 --- a/railties/test/generators/plugin_new_generator_test.rb +++ b/railties/test/generators/plugin_new_generator_test.rb @@ -173,6 +173,7 @@ class PluginNewGeneratorTest < Rails::Generators::TestCase run_generator assert_file "bukkits.gemspec", /s.name = "bukkits"/ assert_file "bukkits.gemspec", /s.files = Dir\["\{app,config,lib\}\/\*\*\/\*"\]/ + assert_file "bukkits.gemspec", /s.test_files = Dir\["test\/\*\*\/\*"\]/ assert_file "bukkits.gemspec", /s.version = "0.0.1"/ end @@ -195,6 +196,12 @@ class PluginNewGeneratorTest < Rails::Generators::TestCase assert_no_file "test" end + def test_skipping_test_unit + run_generator [destination_root, "--skip-test-unit"] + assert_no_file "test" + assert_no_match(/s.test_files = Dir\["test\/\*\*\/\*"\]/, File.read(File.join(destination_root, "bukkits.gemspec"))) + end + def test_skipping_gemspec run_generator [destination_root, "--skip-gemspec"] assert_no_file "bukkits.gemspec" |