summaryrefslogtreecommitdiff
path: root/spec/lib/gitlab/config/entry/unspecified_spec.rb
diff options
context:
space:
mode:
authorKamil Trzciński <ayufan@ayufan.eu>2018-11-29 12:44:48 +0100
committerKamil Trzciński <ayufan@ayufan.eu>2018-11-29 16:09:18 +0100
commit64b1044e7ac22d14a9c17ef773dd075b74df00fa (patch)
tree7b3c6d04c96ceb9183c745d67c34c8b9d4c8da1b /spec/lib/gitlab/config/entry/unspecified_spec.rb
parent6775dafa3816239f6fa1b12428df42572be5a158 (diff)
downloadgitlab-ce-64b1044e7ac22d14a9c17ef773dd075b74df00fa.tar.gz
ci/config: generalize Config validation into Gitlab::Config:: module
This decouples Ci::Config to provide a common interface for handling user configuration files.
Diffstat (limited to 'spec/lib/gitlab/config/entry/unspecified_spec.rb')
-rw-r--r--spec/lib/gitlab/config/entry/unspecified_spec.rb32
1 files changed, 32 insertions, 0 deletions
diff --git a/spec/lib/gitlab/config/entry/unspecified_spec.rb b/spec/lib/gitlab/config/entry/unspecified_spec.rb
new file mode 100644
index 00000000000..64421824a12
--- /dev/null
+++ b/spec/lib/gitlab/config/entry/unspecified_spec.rb
@@ -0,0 +1,32 @@
+require 'spec_helper'
+
+describe Gitlab::Config::Entry::Unspecified do
+ let(:unspecified) { described_class.new(entry) }
+ let(:entry) { spy('Entry') }
+
+ describe '#valid?' do
+ it 'delegates method to entry' do
+ expect(unspecified.valid?).to eq entry
+ end
+ end
+
+ describe '#errors' do
+ it 'delegates method to entry' do
+ expect(unspecified.errors).to eq entry
+ end
+ end
+
+ describe '#value' do
+ it 'delegates method to entry' do
+ expect(unspecified.value).to eq entry
+ end
+ end
+
+ describe '#specified?' do
+ it 'is always false' do
+ allow(entry).to receive(:specified?).and_return(true)
+
+ expect(unspecified.specified?).to be false
+ end
+ end
+end