Add ci config global and before_script entries
This commit is contained in:
parent
23030439c2
commit
6609589b93
|
@ -0,0 +1,15 @@
|
||||||
|
module Gitlab
|
||||||
|
module Ci
|
||||||
|
class Config
|
||||||
|
module Entry
|
||||||
|
class BaseEntry
|
||||||
|
def initialize(hash, config, parent = nil)
|
||||||
|
@hash = hash
|
||||||
|
@config = config
|
||||||
|
@parent = parent
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
|
@ -0,0 +1,13 @@
|
||||||
|
module Gitlab
|
||||||
|
module Ci
|
||||||
|
class Config
|
||||||
|
module Entry
|
||||||
|
class BeforeScript < BaseEntry
|
||||||
|
def leaf?
|
||||||
|
true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
|
@ -0,0 +1,13 @@
|
||||||
|
module Gitlab
|
||||||
|
module Ci
|
||||||
|
class Config
|
||||||
|
module Entry
|
||||||
|
class Global < BaseEntry
|
||||||
|
def allowed_keys
|
||||||
|
[]
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
|
@ -0,0 +1,11 @@
|
||||||
|
require 'spec_helper'
|
||||||
|
|
||||||
|
describe Gitlab::Ci::Config::Entry::BeforeScript do
|
||||||
|
let(:entry) { described_class.new(hash, config) }
|
||||||
|
|
||||||
|
describe '#leaf?' do
|
||||||
|
it 'is a leaf entry' do
|
||||||
|
expect(entry).to be_leaf
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
|
@ -0,0 +1,5 @@
|
||||||
|
require 'spec_helper'
|
||||||
|
|
||||||
|
describe Gitlab::Ci::Config::Entry::Global do
|
||||||
|
|
||||||
|
end
|
|
@ -37,7 +37,8 @@ describe Gitlab::Ci::Config do
|
||||||
describe '.new' do
|
describe '.new' do
|
||||||
it 'raises error' do
|
it 'raises error' do
|
||||||
expect { config }.to raise_error(
|
expect { config }.to raise_error(
|
||||||
Gitlab::Ci::Config::LoaderError, /Invalid configuration format/
|
Gitlab::Ci::Config::LoaderError,
|
||||||
|
/Invalid configuration format/
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue