From 996092ec18ac3ad9e0c573da73325fdc34aefac0 Mon Sep 17 00:00:00 2001 From: "yuuji.yaginuma" Date: Sun, 24 Apr 2016 13:40:58 +0900 Subject: register rake options to `OptionParser` In order to prevent `OptionParser::ParseError` when specify the rake options to `routes` task. --- railties/test/application/rake_test.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'railties/test') diff --git a/railties/test/application/rake_test.rb b/railties/test/application/rake_test.rb index 1a786a3fd3..1fa5b5e2b5 100644 --- a/railties/test/application/rake_test.rb +++ b/railties/test/application/rake_test.rb @@ -228,6 +228,17 @@ module ApplicationTests MESSAGE end + def test_rake_routes_with_rake_options + app_file "config/routes.rb", <<-RUBY + Rails.application.routes.draw do + get '/cart', to: 'cart#show' + end + RUBY + + output = Dir.chdir(app_path){ `bin/rake --rakefile Rakefile routes` } + assert_equal "Prefix Verb URI Pattern Controller#Action\n cart GET /cart(.:format) cart#show\n", output + end + def test_logger_is_flushed_when_exiting_production_rake_tasks add_to_config <<-RUBY rake_tasks do -- cgit v1.2.3