-
-
Notifications
You must be signed in to change notification settings - Fork 934
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move HOST_DISPLAY config into rubygems.yml
- Loading branch information
1 parent
a786900
commit 6618c05
Showing
3 changed files
with
34 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
require "test_helper" | ||
|
||
# These tests just spot check to make sure config is loaded correctly and the file is not broken or missing | ||
class GemcutterConfigTest < ActiveSupport::TestCase | ||
context "Gemcutter.config[:host_display]" do | ||
should "be set for test environment" do | ||
assert_equal "RubyGems.org", Gemcutter.config[:host_display] | ||
end | ||
|
||
should "have a setting for each regularly used environment" do | ||
assert_equal "RubyGems.org", Gemcutter::Application.config_for(:rubygems, env: "development").fetch(:host_display) | ||
assert_equal "RubyGems.org", Gemcutter::Application.config_for(:rubygems, env: "production").fetch(:host_display) | ||
assert_equal "RubyGems.org Staging", Gemcutter::Application.config_for(:rubygems, env: "staging").fetch(:host_display) | ||
end | ||
end | ||
|
||
context "Gemcutter.config[:host]" do | ||
should "be set for test environment" do | ||
assert_equal "localhost", Gemcutter.config[:host] | ||
end | ||
|
||
should "have a setting for each regularly used environment" do | ||
assert_equal "localhost", Gemcutter::Application.config_for(:rubygems, env: "development").fetch(:host_display) | ||
assert_equal "rubygems.org", Gemcutter::Application.config_for(:rubygems, env: "production").fetch(:host_display) | ||
assert_equal "staging.rubygems.org", Gemcutter::Application.config_for(:rubygems, env: "staging").fetch(:host_display) | ||
end | ||
end | ||
end |