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

26 lines
786 B
Ruby

require 'abstract_unit'
require 'rails/commands/server'
class Rails::ServerTest < ActiveSupport::TestCase
def test_environment_with_server_option
args = ["thin", "-e", "production"]
options = Rails::Server::Options.new.parse!(args)
assert_equal 'production', options[:environment]
assert_equal 'thin', options[:server]
end
def test_environment_without_server_option
args = ["-e", "production"]
options = Rails::Server::Options.new.parse!(args)
assert_equal 'production', options[:environment]
assert_nil options[:server]
end
def test_server_option_without_environment
args = ["thin"]
options = Rails::Server::Options.new.parse!(args)
assert_nil options[:environment]
assert_equal 'thin', options[:server]
end
end