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
5ef104df
Commit
5ef104df
authored
Jun 07, 2016
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve Ci config loader by changing method signature
parent
fa097c67
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
6 deletions
+6
-6
config.rb
lib/gitlab/ci/config.rb
+1
-1
loader.rb
lib/gitlab/ci/config/loader.rb
+1
-1
loader_spec.rb
spec/lib/gitlab/ci/config/loader_spec.rb
+4
-4
No files found.
lib/gitlab/ci/config.rb
View file @
5ef104df
...
@@ -5,7 +5,7 @@ module Gitlab
...
@@ -5,7 +5,7 @@ module Gitlab
def
initialize
(
config
)
def
initialize
(
config
)
loader
=
Loader
.
new
(
config
)
loader
=
Loader
.
new
(
config
)
@config
=
loader
.
load
@config
=
loader
.
load
!
end
end
def
to_hash
def
to_hash
...
...
lib/gitlab/ci/config/loader.rb
View file @
5ef104df
...
@@ -12,7 +12,7 @@ module Gitlab
...
@@ -12,7 +12,7 @@ module Gitlab
@config
.
is_a?
(
Hash
)
@config
.
is_a?
(
Hash
)
end
end
def
load
def
load
!
unless
valid?
unless
valid?
raise
FormatError
,
'Invalid configuration format'
raise
FormatError
,
'Invalid configuration format'
end
end
...
...
spec/lib/gitlab/ci/config/loader_spec.rb
View file @
5ef104df
...
@@ -12,9 +12,9 @@ describe Gitlab::Ci::Config::Loader do
...
@@ -12,9 +12,9 @@ describe Gitlab::Ci::Config::Loader do
end
end
end
end
describe
'#load'
do
describe
'#load
!
'
do
it
'returns a valid hash'
do
it
'returns a valid hash'
do
expect
(
loader
.
load
).
to
eq
(
image:
'ruby:2.2'
)
expect
(
loader
.
load
!
).
to
eq
(
image:
'ruby:2.2'
)
end
end
end
end
end
end
...
@@ -28,9 +28,9 @@ describe Gitlab::Ci::Config::Loader do
...
@@ -28,9 +28,9 @@ describe Gitlab::Ci::Config::Loader do
end
end
end
end
describe
'#load'
do
describe
'#load
!
'
do
it
'raises error'
do
it
'raises error'
do
expect
{
loader
.
load
}.
to
raise_error
(
expect
{
loader
.
load
!
}.
to
raise_error
(
Gitlab
::
Ci
::
Config
::
Loader
::
FormatError
,
Gitlab
::
Ci
::
Config
::
Loader
::
FormatError
,
'Invalid configuration format'
'Invalid configuration format'
)
)
...
...
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