aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test/generators
diff options
context:
space:
mode:
authorYoshiyuki Hirano <yhirano@me.com>2017-08-07 20:46:14 +0900
committerYoshiyuki Hirano <yhirano@me.com>2017-08-09 07:18:56 +0900
commit62499cb6e088c3bc32a9396322c7473a17a28640 (patch)
treeb0b9ebcbf8332a237728f5db86d3c03a2fd375d0 /railties/test/generators
parent220049fb32152aa3e1124f77c3d7ee8d0347a9ed (diff)
downloadrails-62499cb6e088c3bc32a9396322c7473a17a28640.tar.gz
rails-62499cb6e088c3bc32a9396322c7473a17a28640.tar.bz2
rails-62499cb6e088c3bc32a9396322c7473a17a28640.zip
Skip unused components when running in Rails plugin
Diffstat (limited to 'railties/test/generators')
-rw-r--r--railties/test/generators/plugin_generator_test.rb14
1 files changed, 13 insertions, 1 deletions
diff --git a/railties/test/generators/plugin_generator_test.rb b/railties/test/generators/plugin_generator_test.rb
index 1dfff38543..a08f68ecad 100644
--- a/railties/test/generators/plugin_generator_test.rb
+++ b/railties/test/generators/plugin_generator_test.rb
@@ -75,6 +75,18 @@ class PluginGeneratorTest < Rails::Generators::TestCase
assert_no_file "bin/rails"
end
+ def test_generating_in_full_mode_with_almost_of_all_skip_options
+ run_generator [destination_root, "--full", "-M", "-O", "-C", "-S", "-T"]
+ assert_file "bin/rails" do |content|
+ assert_no_match(/\s+require\s+["']rails\/all["']/, content)
+ end
+ assert_file "bin/rails", /#\s+require\s+["']active_record\/railtie["']/
+ assert_file "bin/rails", /#\s+require\s+["']action_mailer\/railtie["']/
+ assert_file "bin/rails", /#\s+require\s+["']action_cable\/engine["']/
+ assert_file "bin/rails", /#\s+require\s+["']sprockets\/railtie["']/
+ assert_file "bin/rails", /#\s+require\s+["']rails\/test_unit\/railtie["']/
+ end
+
def test_generating_test_files_in_full_mode
run_generator [destination_root, "--full"]
assert_directory "test/integration/"
@@ -277,7 +289,7 @@ class PluginGeneratorTest < Rails::Generators::TestCase
assert_file "app/views"
assert_file "app/helpers"
assert_file "app/mailers"
- assert_file "bin/rails"
+ assert_file "bin/rails", /\s+require\s+["']rails\/all["']/
assert_file "config/routes.rb", /Rails.application.routes.draw do/
assert_file "lib/bukkits/engine.rb", /module Bukkits\n class Engine < ::Rails::Engine\n end\nend/
assert_file "lib/bukkits.rb", /require "bukkits\/engine"/