Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
heptapod
heptapod
Commits
eee877f91f96
Commit
94190461
authored
Oct 15, 2015
by
Kamil Trzcinski
Browse files
Fix specs
parent
0620f7cdb050
Changes
3
Hide whitespace changes
Inline
Side-by-side
lib/ci/gitlab_ci_yaml_processor.rb
View file @
eee877f9
...
...
@@ -187,7 +187,7 @@ def validate_job!(name, job)
end
if
job
[
:when
]
&&
!
job
[
:when
].
in?
(
%w(on_success on_failure always)
)
raise
ValidationError
,
"
#{
name
}
: when should be on_success, on_failure or always"
raise
ValidationError
,
"
#{
name
}
: when
parameter
should be on_success, on_failure or always"
end
end
...
...
spec/lib/ci/gitlab_ci_yaml_processor_spec.rb
View file @
eee877f9
...
...
@@ -24,7 +24,8 @@ module Ci
commands:
"pwd
\n
rspec"
,
tag_list:
[],
options:
{},
allow_failure:
false
allow_failure:
false
,
when:
"on_success"
})
end
...
...
@@ -330,7 +331,7 @@ module Ci
end
it
"returns errors if job when is not on_success, on_failure or always"
do
config
=
YAML
.
dump
({
rspec:
{
script:
"test"
,
when:
false
}
})
config
=
YAML
.
dump
({
rspec:
{
script:
"test"
,
when:
1
}
})
expect
do
GitlabCiYamlProcessor
.
new
(
config
)
end
.
to
raise_error
(
GitlabCiYamlProcessor
::
ValidationError
,
"rspec job: when parameter should be on_success, on_failure or always"
)
...
...
spec/models/ci/commit_spec.rb
View file @
eee877f9
...
...
@@ -248,7 +248,7 @@ def create_develop_builds
end
context
'properly creates builds "when" is defined'
do
let
(
:yaml
)
{
let
(
:yaml
)
do
{
stages:
[
"build"
,
"test"
,
"test_failure"
,
"deploy"
,
"cleanup"
],
build:
{
...
...
@@ -274,7 +274,7 @@ def create_develop_builds
when:
"always"
,
}
}
}
end
before
do
stub_ci_commit_yaml_file
(
YAML
.
dump
(
yaml
))
...
...
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