aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test
diff options
context:
space:
mode:
authoryuuji.yaginuma <yuuji.yaginuma@gmail.com>2017-05-19 15:13:05 +0900
committeryuuji.yaginuma <yuuji.yaginuma@gmail.com>2017-05-24 16:11:52 +0900
commit7a154ab380501050e6ce20463de8f702353bceb0 (patch)
tree7ae1d2ae6e992f482f14d0027bf394076e4b97cf /railties/test
parente5a9d289b16592f395fb528c9688604c02bd2e33 (diff)
downloadrails-7a154ab380501050e6ce20463de8f702353bceb0.tar.gz
rails-7a154ab380501050e6ce20463de8f702353bceb0.tar.bz2
rails-7a154ab380501050e6ce20463de8f702353bceb0.zip
Correctly set user_supplied_options when there is no whitespace in option specification
Current `user_supplied_options` method can not set the value correctly if there is no space between option and value (e.g., `-p9000`). This makes it possible to set the value correctly in the case like the above. Fixes #29138
Diffstat (limited to 'railties/test')
-rw-r--r--railties/test/commands/server_test.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/railties/test/commands/server_test.rb b/railties/test/commands/server_test.rb
index 7731d10d9b..722323efdc 100644
--- a/railties/test/commands/server_test.rb
+++ b/railties/test/commands/server_test.rb
@@ -165,6 +165,12 @@ class Rails::ServerTest < ActiveSupport::TestCase
server_options = parse_arguments(["--port", 3001])
assert_equal [:Port], server_options[:user_supplied_options]
+
+ server_options = parse_arguments(["-p3001", "-C", "--binding", "127.0.0.1"])
+ assert_equal [:Port, :Host, :caching], server_options[:user_supplied_options]
+
+ server_options = parse_arguments(["--port=3001"])
+ assert_equal [:Port], server_options[:user_supplied_options]
end
def test_default_options