aboutsummaryrefslogtreecommitdiffstats
path: root/railties
diff options
context:
space:
mode:
authorRob Zolkos <rob@funkyhive.com.au>2010-10-20 00:15:35 +1100
committerJosé Valim <jose.valim@gmail.com>2010-11-11 17:35:18 +0100
commitbafa1533f414a3d3c02528b774e5cf28e85774b5 (patch)
tree0bdd5ee05fae88f1b4740da7587003baa11e7989 /railties
parent37d3266f35e1947f43046fb8296c560145f2b53e (diff)
downloadrails-bafa1533f414a3d3c02528b774e5cf28e85774b5.tar.gz
rails-bafa1533f414a3d3c02528b774e5cf28e85774b5.tar.bz2
rails-bafa1533f414a3d3c02528b774e5cf28e85774b5.zip
skip testing framework if app created with --skip-test-unit [#5796 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
Diffstat (limited to 'railties')
-rw-r--r--railties/lib/rails/generators/rails/app/templates/config/application.rb4
-rw-r--r--railties/test/generators/app_generator_test.rb7
2 files changed, 11 insertions, 0 deletions
diff --git a/railties/lib/rails/generators/rails/app/templates/config/application.rb b/railties/lib/rails/generators/rails/app/templates/config/application.rb
index 00a23a7b89..6e515756fe 100644
--- a/railties/lib/rails/generators/rails/app/templates/config/application.rb
+++ b/railties/lib/rails/generators/rails/app/templates/config/application.rb
@@ -48,6 +48,10 @@ module <%= app_const_base %>
# config.action_view.javascript_expansions[:defaults] = %w(jquery rails)
<% end -%>
+<% if options[:skip_test_unit] -%>
+ config.generators.test_framework = false
+<% end -%>
+
# Configure the default encoding used in templates for Ruby 1.9.
config.encoding = "utf-8"
diff --git a/railties/test/generators/app_generator_test.rb b/railties/test/generators/app_generator_test.rb
index c7339cb8d2..f4d2027874 100644
--- a/railties/test/generators/app_generator_test.rb
+++ b/railties/test/generators/app_generator_test.rb
@@ -188,6 +188,13 @@ class AppGeneratorTest < Rails::Generators::TestCase
assert_file "test"
end
+ def test_test_unit_is_removed_from_frameworks_if_skip_test_unit_is_given
+ run_generator [destination_root, "--skip-test-unit"]
+ assert_file "config/application.rb" do |file|
+ assert_match /config.generators.test_framework = false/, file
+ end
+ end
+
def test_test_unit_is_skipped_if_required
run_generator [destination_root, "--skip-test-unit"]
assert_no_file "test"