1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Use string for arguments in server test

When actually execute from the command, the value of ARGV is passed to the
server. So they are String. So let's use the same type in the test.

Also, this removes the following warning in Ruby 2.6.

```
lib/rails/commands/server/server_command.rb:195: warning: deprecated Object#=~ is called on Integer; it always returns nil
```
This commit is contained in:
yuuji.yaginuma 2018-12-13 16:14:13 +09:00
parent 1800300296
commit d0bb649cbf

View file

@ -225,10 +225,10 @@ class Rails::Command::ServerCommandTest < ActiveSupport::TestCase
end end
def test_records_user_supplied_options def test_records_user_supplied_options
server_options = parse_arguments(["-p", 3001]) server_options = parse_arguments(["-p", "3001"])
assert_equal [:Port], server_options[:user_supplied_options] assert_equal [:Port], server_options[:user_supplied_options]
server_options = parse_arguments(["--port", 3001]) server_options = parse_arguments(["--port", "3001"])
assert_equal [:Port], server_options[:user_supplied_options] assert_equal [:Port], server_options[:user_supplied_options]
server_options = parse_arguments(["-p3001", "-C", "--binding", "127.0.0.1"]) server_options = parse_arguments(["-p3001", "-C", "--binding", "127.0.0.1"])