BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
30f58cf3
Commit
30f58cf3
authored
Aug 25, 2016
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add [] method for accessing ci entry dependencies
parent
4f837f66
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
0 deletions
+27
-0
entry.rb
lib/gitlab/ci/config/node/entry.rb
+4
-0
global_spec.rb
spec/lib/gitlab/ci/config/node/global_spec.rb
+23
-0
No files found.
lib/gitlab/ci/config/node/entry.rb
View file @
30f58cf3
...
...
@@ -20,6 +20,10 @@ module Gitlab
@validator
.
validate
(
:new
)
end
def
[]
(
key
)
@entries
[
key
]
||
Node
::
Undefined
.
new
end
def
compose!
(
deps
=
nil
)
return
unless
valid?
...
...
spec/lib/gitlab/ci/config/node/global_spec.rb
View file @
30f58cf3
...
...
@@ -253,4 +253,27 @@ describe Gitlab::Ci::Config::Node::Global do
expect
(
global
.
specified?
).
to
be
true
end
end
describe
'#[]'
do
before
{
global
.
compose!
}
let
(
:hash
)
do
{
cache:
{
key:
'a'
},
rspec:
{
script:
'ls'
}
}
end
context
'when node exists'
do
it
'returns correct entry'
do
expect
(
global
[
:cache
])
.
to
be_an_instance_of
Gitlab
::
Ci
::
Config
::
Node
::
Cache
expect
(
global
[
:jobs
][
:rspec
][
:script
].
value
).
to
eq
[
'ls'
]
end
end
context
'when node does not exist'
do
it
'always return unspecified node'
do
expect
(
global
[
:some
][
:unknown
][
:node
])
.
not_to
be_specified
end
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