debian-mirror-gitlab/spec/lib/gitlab/ci/config/entry/hidden_spec.rb

48 lines
972 B
Ruby
Raw Normal View History

2016-09-13 17:45:13 +05:30
require 'spec_helper'
2017-08-17 22:00:37 +05:30
describe Gitlab::Ci::Config::Entry::Hidden do
2016-09-13 17:45:13 +05:30
let(:entry) { described_class.new(config) }
describe 'validations' do
context 'when entry config value is correct' do
2016-09-29 09:46:39 +05:30
let(:config) { [:some, :array] }
2016-09-13 17:45:13 +05:30
describe '#value' do
it 'returns key value' do
2016-09-29 09:46:39 +05:30
expect(entry.value).to eq [:some, :array]
2016-09-13 17:45:13 +05:30
end
end
describe '#valid?' do
it 'is valid' do
expect(entry).to be_valid
end
end
end
context 'when entry value is not correct' do
context 'when config is empty' do
let(:config) { {} }
describe '#valid' do
it 'is invalid' do
expect(entry).not_to be_valid
end
end
end
end
end
describe '#leaf?' do
it 'is a leaf' do
expect(entry).to be_leaf
end
end
describe '#relevant?' do
it 'is not a relevant entry' do
expect(entry).not_to be_relevant
end
end
end