Add ci config global and before_script entries

This commit is contained in:
Grzegorz Bizon 2016-06-06 09:05:00 +02:00
parent 23030439c2
commit 6609589b93
6 changed files with 59 additions and 1 deletions

View File

@ -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

View File

@ -0,0 +1,13 @@
module Gitlab
module Ci
class Config
module Entry
class BeforeScript < BaseEntry
def leaf?
true
end
end
end
end
end
end

View File

@ -0,0 +1,13 @@
module Gitlab
module Ci
class Config
module Entry
class Global < BaseEntry
def allowed_keys
[]
end
end
end
end
end
end

View File

@ -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

View File

@ -0,0 +1,5 @@
require 'spec_helper'
describe Gitlab::Ci::Config::Entry::Global do
end

View File

@ -37,7 +37,8 @@ describe Gitlab::Ci::Config do
describe '.new' do
it 'raises error' do
expect { config }.to raise_error(
Gitlab::Ci::Config::LoaderError, /Invalid configuration format/
Gitlab::Ci::Config::LoaderError,
/Invalid configuration format/
)
end
end