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
25dd1712
Commit
25dd1712
authored
Oct 17, 2016
by
Kamil Trzcinski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add specs to test on_stop and action on environments
parent
50d97527
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
2 deletions
+6
-2
environment.rb
lib/gitlab/ci/config/node/environment.rb
+4
-0
environment_spec.rb
spec/lib/gitlab/ci/config/node/environment_spec.rb
+2
-2
No files found.
lib/gitlab/ci/config/node/environment.rb
View file @
25dd1712
...
...
@@ -64,6 +64,10 @@ module Gitlab
value
[
:action
]
||
'start'
end
def
on_stop
value
[
:on_stop
]
end
def
value
case
@config
when
String
then
{
name:
@config
,
action:
'start'
}
...
...
spec/lib/gitlab/ci/config/node/environment_spec.rb
View file @
25dd1712
...
...
@@ -101,7 +101,7 @@ describe Gitlab::Ci::Config::Node::Environment do
context
'when invalid action is used'
do
let
(
:config
)
do
{
name:
'production'
,
action:
false
}
action:
'invalid'
}
end
describe
'#valid?'
do
...
...
@@ -144,7 +144,7 @@ describe Gitlab::Ci::Config::Node::Environment do
describe
'#errors'
do
it
'contains error about invalid action'
do
expect
(
entry
.
errors
)
.
to
include
'environment
action should be start or stop
'
.
to
include
'environment
on stop should be a string
'
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