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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
4c34b4e5
Commit
4c34b4e5
authored
Nov 22, 2016
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Extend specs for global ci configuration entry
parent
900999f8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
18 deletions
+31
-18
spec/lib/gitlab/ci/config/entry/global_spec.rb
spec/lib/gitlab/ci/config/entry/global_spec.rb
+31
-18
No files found.
spec/lib/gitlab/ci/config/entry/global_spec.rb
View file @
4c34b4e5
...
@@ -13,7 +13,7 @@ describe Gitlab::Ci::Config::Entry::Global do
...
@@ -13,7 +13,7 @@ describe Gitlab::Ci::Config::Entry::Global do
end
end
end
end
context
'when
hash
is valid'
do
context
'when
configuration
is valid'
do
context
'when some entries defined'
do
context
'when some entries defined'
do
let
(
:hash
)
do
let
(
:hash
)
do
{
before_script:
[
'ls'
,
'pwd'
],
{
before_script:
[
'ls'
,
'pwd'
],
...
@@ -225,29 +225,42 @@ describe Gitlab::Ci::Config::Entry::Global do
...
@@ -225,29 +225,42 @@ describe Gitlab::Ci::Config::Entry::Global do
end
end
end
end
context
'when
hash
is not valid'
do
context
'when
configuration
is not valid'
do
before
{
global
.
compose!
}
before
{
global
.
compose!
}
let
(
:hash
)
do
context
'when before script is not an array'
do
{
before_script:
'ls'
}
let
(
:hash
)
do
end
{
before_script:
'ls'
}
end
describe
'#valid?'
do
describe
'#valid?'
do
it
'is not valid'
do
it
'is not valid'
do
expect
(
global
).
not_to
be_valid
expect
(
global
).
not_to
be_valid
end
end
end
end
describe
'#errors'
do
describe
'#errors'
do
it
'reports errors from child nodes'
do
it
'reports errors from child nodes'
do
expect
(
global
.
errors
)
expect
(
global
.
errors
)
.
to
include
'before_script config should be an array of strings'
.
to
include
'before_script config should be an array of strings'
end
end
describe
'#before_script_value'
do
it
'returns nil'
do
expect
(
global
.
before_script_value
).
to
be_nil
end
end
end
end
end
describe
'#before_script_value'
do
context
'when job does not have commands'
do
it
'returns nil'
do
let
(
:hash
)
{
{
rspec:
{
stage:
'test'
}
}
}
expect
(
global
.
before_script_value
).
to
be_nil
describe
'#errors'
do
it
'reports errors about missing script'
do
expect
(
global
.
errors
)
.
to
include
"jobs:rspec script can't be blank"
end
end
end
end
end
end
end
...
@@ -281,7 +294,7 @@ describe Gitlab::Ci::Config::Entry::Global do
...
@@ -281,7 +294,7 @@ describe Gitlab::Ci::Config::Entry::Global do
{
cache:
{
key:
'a'
},
rspec:
{
script:
'ls'
}
}
{
cache:
{
key:
'a'
},
rspec:
{
script:
'ls'
}
}
end
end
context
'when
node
exists'
do
context
'when
entry
exists'
do
it
'returns correct entry'
do
it
'returns correct entry'
do
expect
(
global
[
:cache
])
expect
(
global
[
:cache
])
.
to
be_an_instance_of
Gitlab
::
Ci
::
Config
::
Entry
::
Cache
.
to
be_an_instance_of
Gitlab
::
Ci
::
Config
::
Entry
::
Cache
...
@@ -289,7 +302,7 @@ describe Gitlab::Ci::Config::Entry::Global do
...
@@ -289,7 +302,7 @@ describe Gitlab::Ci::Config::Entry::Global do
end
end
end
end
context
'when
node
does not exist'
do
context
'when
entry
does not exist'
do
it
'always return unspecified node'
do
it
'always return unspecified node'
do
expect
(
global
[
:some
][
:unknown
][
:node
])
expect
(
global
[
:some
][
:unknown
][
:node
])
.
not_to
be_specified
.
not_to
be_specified
...
...
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