Commit 59eeec3f authored by Grzegorz Bizon's avatar Grzegorz Bizon

Make method that composes ci config entry private

parent ebe14437
......@@ -38,7 +38,7 @@ module Gitlab
class_methods do
def allowed_nodes
Hash[@allowed_nodes.map { |key, factory| [key, factory.dup] } ]
Hash[@allowed_nodes.map { |key, factory| [key, factory.dup] }]
end
private
......
......@@ -26,12 +26,6 @@ module Gitlab
nodes.each(&:validate!)
end
def compose!
allowed_nodes.each do |key, essence|
@nodes[key] = create_node(key, essence)
end
end
def nodes
@nodes.values
end
......@@ -62,6 +56,12 @@ module Gitlab
private
def compose!
allowed_nodes.each do |key, essence|
@nodes[key] = create_node(key, essence)
end
end
def create_node(key, essence)
raise NotImplementedError
end
......
......@@ -18,15 +18,6 @@ describe Gitlab::Ci::Config::Node::Global do
{ before_script: ['ls', 'pwd'] }
end
describe '#compose!' do
before { global.compose! }
it 'instantiates entry nodes' do
expect(global.nodes.first)
.to be_an_instance_of Gitlab::Ci::Config::Node::Script
end
end
describe '#process!' do
before { global.process! }
......
......@@ -16,7 +16,7 @@ describe Gitlab::Ci::Config::Node::Null do
end
describe '#value' do
it 'returns nill' do
it 'returns nil' do
expect(entry.value).to be nil
end
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment