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 ...@@ -38,7 +38,7 @@ module Gitlab
class_methods do class_methods do
def allowed_nodes def allowed_nodes
Hash[@allowed_nodes.map { |key, factory| [key, factory.dup] } ] Hash[@allowed_nodes.map { |key, factory| [key, factory.dup] }]
end end
private private
......
...@@ -26,12 +26,6 @@ module Gitlab ...@@ -26,12 +26,6 @@ module Gitlab
nodes.each(&:validate!) nodes.each(&:validate!)
end end
def compose!
allowed_nodes.each do |key, essence|
@nodes[key] = create_node(key, essence)
end
end
def nodes def nodes
@nodes.values @nodes.values
end end
...@@ -62,6 +56,12 @@ module Gitlab ...@@ -62,6 +56,12 @@ module Gitlab
private private
def compose!
allowed_nodes.each do |key, essence|
@nodes[key] = create_node(key, essence)
end
end
def create_node(key, essence) def create_node(key, essence)
raise NotImplementedError raise NotImplementedError
end end
......
...@@ -18,15 +18,6 @@ describe Gitlab::Ci::Config::Node::Global do ...@@ -18,15 +18,6 @@ describe Gitlab::Ci::Config::Node::Global do
{ before_script: ['ls', 'pwd'] } { before_script: ['ls', 'pwd'] }
end 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 describe '#process!' do
before { global.process! } before { global.process! }
......
...@@ -16,7 +16,7 @@ describe Gitlab::Ci::Config::Node::Null do ...@@ -16,7 +16,7 @@ describe Gitlab::Ci::Config::Node::Null do
end end
describe '#value' do describe '#value' do
it 'returns nill' do it 'returns nil' do
expect(entry.value).to be nil expect(entry.value).to be nil
end end
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