Commit 5923741f authored by Grzegorz Bizon's avatar Grzegorz Bizon

Remove references to global entry in new CI config

parent 3e16b015
......@@ -9,7 +9,7 @@ module Gitlab
class InvalidError < StandardError; end
attr_reader :config, :attributes
attr_accessor :key, :parent, :global, :description
attr_accessor :key, :parent, :description
def initialize(config, **attributes)
@config = config
......
......@@ -63,7 +63,6 @@ module Gitlab
node.new(value).tap do |entry|
entry.key = @attributes[:key]
entry.parent = @attributes[:parent] || @parent
entry.global = @attributes[:global] || @parent.global
entry.description = @attributes[:description]
end
end
......
......@@ -5,11 +5,6 @@ describe Gitlab::Ci::Config::Node::Factory do
let(:factory) { described_class.new(node) }
let(:node) { Gitlab::Ci::Config::Node::Script }
let(:parent) { double('parent') }
let(:global) { double('global') }
before do
allow(parent).to receive(:global).and_return(global)
end
context 'when setting a concrete value' do
it 'creates entry with valid value' do
......@@ -21,13 +16,12 @@ describe Gitlab::Ci::Config::Node::Factory do
expect(entry.value).to eq ['ls', 'pwd']
end
it 'sets parent and global attributes' do
it 'sets parent attributes' do
entry = factory
.value('ls')
.parent(parent)
.create!
expect(entry.global).to eq global
expect(entry.parent).to eq parent
end
......
require 'spec_helper'
describe Gitlab::Ci::Config::Node::Job do
let(:entry) { described_class.new(config, attributes) }
let(:attributes) { { key: :rspec, global: global } }
let(:global) { double('global', stages: %w[test]) }
let(:entry) { described_class.new(config, key: :rspec) }
before do
entry.process!
......@@ -21,7 +19,7 @@ describe Gitlab::Ci::Config::Node::Job do
end
context 'when job name is empty' do
let(:attributes) { { key: '', global: global } }
let(:entry) { described_class.new(config, key: ''.to_sym) }
it 'reports error' do
expect(entry.errors)
......
require 'spec_helper'
describe Gitlab::Ci::Config::Node::Jobs do
let(:entry) { described_class.new(config, global: global) }
let(:global) { double('global', before_script: nil, stages: %w[test]) }
let(:entry) { described_class.new(config) }
describe 'validations' do
before do
......
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