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
Jérome Perrin
gitlab-ce
Commits
d55ff247
Commit
d55ff247
authored
Dec 02, 2016
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement extended pipeline - status with warnings
parent
c7c24940
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
77 additions
and
0 deletions
+77
-0
spec/lib/gitlab/ci/status/extended/base_spec.rb
spec/lib/gitlab/ci/status/extended/base_spec.rb
+12
-0
spec/lib/gitlab/ci/status/extended/pipeline/success_with_warnings_spec.rb
...ci/status/extended/pipeline/success_with_warnings_spec.rb
+65
-0
No files found.
spec/lib/gitlab/ci/status/extended/base_spec.rb
View file @
d55ff247
require
'spec_helper'
describe
Gitlab
::
Ci
::
Status
::
Extended
::
Base
do
subject
do
Class
.
new
.
extend
(
described_class
)
end
it
'requires subclass to implement matcher'
do
expect
{
subject
.
matches?
(
double
)
}
.
to
raise_error
(
NotImplementedError
)
end
end
spec/lib/gitlab/ci/status/extended/pipeline/success_with_warnings_spec.rb
View file @
d55ff247
require
'spec_helper'
describe
Gitlab
::
Ci
::
Status
::
Extended
::
Pipeline
::
SuccessWithWarnings
do
subject
do
described_class
.
new
(
double
(
'status'
))
end
describe
'#test'
do
it
{
expect
(
subject
.
text
).
to
eq
'passed'
}
end
describe
'#label'
do
it
{
expect
(
subject
.
label
).
to
eq
'passed with warnings'
}
end
describe
'#icon'
do
it
{
expect
(
subject
.
icon
).
to
eq
'icon_status_warning'
}
end
describe
'.matches?'
do
context
'when pipeline is successful'
do
let
(
:pipeline
)
do
create
(
:ci_pipeline
,
status: :success
)
end
context
'when pipeline has warnings'
do
before
do
allow
(
pipeline
).
to
receive
(
:has_warnings?
).
and_return
(
true
)
end
it
'is a correct match'
do
expect
(
described_class
.
matches?
(
pipeline
)).
to
eq
true
end
end
context
'when pipeline does not have warnings'
do
it
'does not match'
do
expect
(
described_class
.
matches?
(
pipeline
)).
to
eq
false
end
end
end
context
'when pipeline is not successful'
do
let
(
:pipeline
)
do
create
(
:ci_pipeline
,
status: :skipped
)
end
context
'when pipeline has warnings'
do
before
do
allow
(
pipeline
).
to
receive
(
:has_warnings?
).
and_return
(
true
)
end
it
'does not match'
do
expect
(
described_class
.
matches?
(
pipeline
)).
to
eq
false
end
end
context
'when pipeline does not have warnings'
do
it
'does not match'
do
expect
(
described_class
.
matches?
(
pipeline
)).
to
eq
false
end
end
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