diff options
-rw-r--r-- | activerecord/activerecord.gemspec | 2 | ||||
-rw-r--r-- | activeresource/activeresource.gemspec | 2 | ||||
-rw-r--r-- | activesupport/activesupport.gemspec | 2 | ||||
-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 | 11 |
5 files changed, 16 insertions, 4 deletions
diff --git a/activerecord/activerecord.gemspec b/activerecord/activerecord.gemspec index 43a1258c20..b7e23faa09 100644 --- a/activerecord/activerecord.gemspec +++ b/activerecord/activerecord.gemspec @@ -13,7 +13,7 @@ Gem::Specification.new do |s| s.email = 'david@loudthinking.com' s.homepage = 'http://www.rubyonrails.org' - s.files = Dir['CHANGELOG', 'README.rdoc', 'examples/**/*', 'lib/**/*'] + s.files = Dir['CHANGELOG', 'MIT-LICENSE', 'README.rdoc', 'examples/**/*', 'lib/**/*'] s.require_path = 'lib' s.extra_rdoc_files = %w( README.rdoc ) diff --git a/activeresource/activeresource.gemspec b/activeresource/activeresource.gemspec index 400a0d851d..a8772ecf8c 100644 --- a/activeresource/activeresource.gemspec +++ b/activeresource/activeresource.gemspec @@ -13,7 +13,7 @@ Gem::Specification.new do |s| s.email = 'david@loudthinking.com' s.homepage = 'http://www.rubyonrails.org' - s.files = Dir['CHANGELOG', 'README.rdoc', 'examples/**/*', 'lib/**/*'] + s.files = Dir['CHANGELOG', 'MIT-LICENSE', 'README.rdoc', 'examples/**/*', 'lib/**/*'] s.require_path = 'lib' s.extra_rdoc_files = %w( README.rdoc ) diff --git a/activesupport/activesupport.gemspec b/activesupport/activesupport.gemspec index 738a10a18f..2ee6bb788a 100644 --- a/activesupport/activesupport.gemspec +++ b/activesupport/activesupport.gemspec @@ -13,7 +13,7 @@ Gem::Specification.new do |s| s.email = 'david@loudthinking.com' s.homepage = 'http://www.rubyonrails.org' - s.files = Dir['CHANGELOG', 'README.rdoc', 'lib/**/*'] + s.files = Dir['CHANGELOG', 'MIT-LICENSE', 'README.rdoc', 'lib/**/*'] s.require_path = 'lib' s.add_dependency('i18n', '~> 0.6') 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..b93e33f61a 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 @@ -187,7 +188,7 @@ class PluginNewGeneratorTest < Rails::Generators::TestCase assert_file "spec/dummy/config/application.rb" assert_no_file "test/dummy" end - + def test_creating_dummy_without_tests_but_with_dummy_path run_generator [destination_root, "--dummy_path", "spec/dummy", "--skip-test-unit"] assert_file "spec/dummy" @@ -195,6 +196,14 @@ 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_file "bukkits.gemspec" do |contents| + assert_no_match /s.test_files = Dir\["test\/\*\*\/\*"\]/, contents + end + end + def test_skipping_gemspec run_generator [destination_root, "--skip-gemspec"] assert_no_file "bukkits.gemspec" |