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
Léo-Paul Géneau
gitlab-ce
Commits
981c2488
Commit
981c2488
authored
Mar 02, 2019
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Do not raise when adding undefined variables resource
parent
eb2966fa
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
0 deletions
+10
-0
lib/gitlab/ci/variables/collection.rb
lib/gitlab/ci/variables/collection.rb
+2
-0
spec/lib/gitlab/ci/variables/collection_spec.rb
spec/lib/gitlab/ci/variables/collection_spec.rb
+8
-0
No files found.
lib/gitlab/ci/variables/collection.rb
View file @
981c2488
...
@@ -17,6 +17,8 @@ module Gitlab
...
@@ -17,6 +17,8 @@ module Gitlab
end
end
def
concat
(
resources
)
def
concat
(
resources
)
return
self
if
resources
.
nil?
tap
{
resources
.
each
{
|
variable
|
self
.
append
(
variable
)
}
}
tap
{
resources
.
each
{
|
variable
|
self
.
append
(
variable
)
}
}
end
end
...
...
spec/lib/gitlab/ci/variables/collection_spec.rb
View file @
981c2488
...
@@ -66,6 +66,14 @@ describe Gitlab::Ci::Variables::Collection do
...
@@ -66,6 +66,14 @@ describe Gitlab::Ci::Variables::Collection do
expect
(
collection
).
to
include
(
key:
'VAR_3'
,
value:
'3'
,
public:
true
)
expect
(
collection
).
to
include
(
key:
'VAR_3'
,
value:
'3'
,
public:
true
)
end
end
it
'does not concatenate resource if it undefined'
do
collection
=
described_class
.
new
([{
key:
'VAR_1'
,
value:
'1'
}])
collection
.
concat
(
nil
)
expect
(
collection
).
to
be_one
end
it
'returns self'
do
it
'returns self'
do
expect
(
subject
.
concat
([
key:
'VAR'
,
value:
'test'
]))
expect
(
subject
.
concat
([
key:
'VAR'
,
value:
'test'
]))
.
to
eq
subject
.
to
eq
subject
...
...
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