Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Tatuya Kamada
gitlab-ce
Commits
d41d3301
Commit
d41d3301
authored
Jul 12, 2016
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add CI config node that is unspecified null entry
parent
8c9c3eda
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
59 additions
and
0 deletions
+59
-0
lib/gitlab/ci/config/node/null.rb
lib/gitlab/ci/config/node/null.rb
+30
-0
spec/lib/gitlab/ci/config/node/null_spec.rb
spec/lib/gitlab/ci/config/node/null_spec.rb
+29
-0
No files found.
lib/gitlab/ci/config/node/null.rb
0 → 100644
View file @
d41d3301
module
Gitlab
module
Ci
class
Config
module
Node
##
# This class represents an undefined and unspecified node.
#
# Implements the Null Object pattern.
#
class
Null
<
Entry
def
initialize
(
config
=
nil
,
**
attributes
)
super
end
def
value
nil
end
def
valid?
true
end
def
errors
[]
end
end
end
end
end
end
spec/lib/gitlab/ci/config/node/null_spec.rb
0 → 100644
View file @
d41d3301
require
'spec_helper'
describe
Gitlab
::
Ci
::
Config
::
Node
::
Null
do
let
(
:null
)
{
described_class
.
new
}
describe
'#leaf?'
do
it
'is leaf node'
do
expect
(
null
).
to
be_leaf
end
end
describe
'#valid?'
do
it
'is always valid'
do
expect
(
null
).
to
be_valid
end
end
describe
'#errors'
do
it
'is does not contain errors'
do
expect
(
null
.
errors
).
to
be_empty
end
end
describe
'#value'
do
it
'returns nil'
do
expect
(
null
.
value
).
to
eq
nil
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment