-
Notifications
You must be signed in to change notification settings - Fork 21.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5550 from schneems/schneems/server_env
Fix environment support for rails server, and match interface of rails console
- Loading branch information
Showing
4 changed files
with
63 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
require 'abstract_unit' | ||
require 'rails/commands/server' | ||
|
||
class Rails::ServerTest < ActiveSupport::TestCase | ||
|
||
def test_environment_with_server_option | ||
args = ["thin", "RAILS_ENV=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 = ["RAILS_ENV=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 |