Skip to content
Extraits de code Groupes Projets
Valider 408bafca rédigé par Maxwell Salzberg's avatar Maxwell Salzberg
Parcourir les fichiers

add/refactor normalize_pod_services so configured services is always defined...

add/refactor normalize_pod_services so configured services is always defined regardless if SERVICES are set up
parent 2757cbb1
Branches
Étiquettes
Aucune requête de fusion associée trouvée
......@@ -107,14 +107,13 @@ HELP
end
def self.normalize_pod_services
self['configured_services'] = []
if defined?(SERVICES)
configured_services = []
SERVICES.keys.each do |service|
unless SERVICES[service].keys.any?{|service_key| SERVICES[service][service_key].blank?}
configured_services << service
self['configured_services'] << service
end
end
self['configured_services'] = configured_services
end
end
......
......@@ -175,6 +175,22 @@ describe AppConfig do
end
end
describe '.normalize_services' do
before do
@services = SERVICES
Object.send(:remove_const, :SERVICES)
end
after do
SERVICES = @services
end
it 'sets configured_services to an empty array if SERVICES is not defined' do
AppConfig.normalize_pod_services
AppConfig.configured_services.should == []
end
end
describe ".[]=" do
describe "when setting pod_url" do
context "with a symbol" do
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter