diff options
author | Arun Agrawal <arunagw@gmail.com> | 2012-06-08 18:29:23 +0530 |
---|---|---|
committer | Arun Agrawal <arunagw@gmail.com> | 2012-06-08 18:30:18 +0530 |
commit | 8b1d475f9667e9ecc7478e8a01de912cca2a4497 (patch) | |
tree | da2476336659faf2bdac95ca7f64c60b69e43e3b | |
parent | fa352c46da1b89534f2ddb04a602b7d09c0f5872 (diff) | |
download | rails-8b1d475f9667e9ecc7478e8a01de912cca2a4497.tar.gz rails-8b1d475f9667e9ecc7478e8a01de912cca2a4497.tar.bz2 rails-8b1d475f9667e9ecc7478e8a01de912cca2a4497.zip |
We should not include engine.rake file into rake
if we are passing -T which is skip_test_unit
See issue #6673 for more details.
I saw that we are not creating dummy app even if
we do skip_test_unit.
Fixes #6673
-rwxr-xr-x | railties/lib/rails/generators/rails/plugin_new/templates/Rakefile | 2 | ||||
-rw-r--r-- | railties/test/generators/plugin_new_generator_test.rb | 8 |
2 files changed, 9 insertions, 1 deletions
diff --git a/railties/lib/rails/generators/rails/plugin_new/templates/Rakefile b/railties/lib/rails/generators/rails/plugin_new/templates/Rakefile index 6ed6adcf1b..564fda3c49 100755 --- a/railties/lib/rails/generators/rails/plugin_new/templates/Rakefile +++ b/railties/lib/rails/generators/rails/plugin_new/templates/Rakefile @@ -20,7 +20,7 @@ RDoc::Task.new(:rdoc) do |rdoc| rdoc.rdoc_files.include('lib/**/*.rb') end -<% if full? && !options[:skip_active_record] -%> +<% if full? && !options[:skip_active_record] && !options[:skip_test_unit] -%> APP_RAKEFILE = File.expand_path("../<%= dummy_path -%>/Rakefile", __FILE__) load 'rails/tasks/engine.rake' <% end %> diff --git a/railties/test/generators/plugin_new_generator_test.rb b/railties/test/generators/plugin_new_generator_test.rb index b62bd4b131..5c61f4c4e6 100644 --- a/railties/test/generators/plugin_new_generator_test.rb +++ b/railties/test/generators/plugin_new_generator_test.rb @@ -57,6 +57,14 @@ class PluginNewGeneratorTest < Rails::Generators::TestCase assert_file "test/integration/navigation_test.rb", /ActionDispatch::IntegrationTest/ end + def test_generating_test_files_in_full_mode_without_unit_test_files + run_generator [destination_root, "-T", "--full"] + + assert_no_directory "test/integration/" + assert_no_file "test" + assert_no_match(/APP_RAKEFILE/, File.read(File.join(destination_root, "Rakefile"))) + end + def test_ensure_that_plugin_options_are_not_passed_to_app_generator FileUtils.cd(Rails.root) assert_no_match(/It works from file!.*It works_from_file/, run_generator([destination_root, "-m", "lib/template.rb"])) |