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
9410aecc
Commit
9410aecc
authored
Jul 07, 2016
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add scaffold of CI config for the job stage entry
parent
ecdcf04e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
68 additions
and
0 deletions
+68
-0
lib/gitlab/ci/config/node/stage.rb
lib/gitlab/ci/config/node/stage.rb
+22
-0
spec/lib/gitlab/ci/config/node/stage_spec.rb
spec/lib/gitlab/ci/config/node/stage_spec.rb
+46
-0
No files found.
lib/gitlab/ci/config/node/stage.rb
0 → 100644
View file @
9410aecc
module
Gitlab
module
Ci
class
Config
module
Node
##
# Entry that represents a stage for a job.
#
class
Stage
<
Entry
include
Validatable
validations
do
validates
:config
,
key:
true
end
def
self
.
default
:test
end
end
end
end
end
end
spec/lib/gitlab/ci/config/node/stage_spec.rb
0 → 100644
View file @
9410aecc
require
'spec_helper'
describe
Gitlab
::
Ci
::
Config
::
Node
::
Stage
do
let
(
:entry
)
{
described_class
.
new
(
config
)
}
describe
'validations'
do
context
'when entry config value is correct'
do
let
(
:config
)
{
:stage1
}
describe
'#value'
do
it
'returns a stage key'
do
expect
(
entry
.
value
).
to
eq
config
end
end
describe
'#valid?'
do
it
'is valid'
do
expect
(
entry
).
to
be_valid
end
end
context
'when entry config is incorrect'
do
let
(
:config
)
{
{
test:
true
}
}
describe
'#errors'
do
it
'reports errors'
do
expect
(
entry
.
errors
)
.
to
include
'stage config should be a string or symbol'
end
end
describe
'#valid?'
do
it
'is not valid'
do
expect
(
entry
).
not_to
be_valid
end
end
end
end
end
describe
'.default'
do
it
'returns default stage'
do
expect
(
described_class
.
default
).
to
eq
:test
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