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
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
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
6 deletions
+6
-6
lib/gitlab/ci/config.rb
lib/gitlab/ci/config.rb
+1
-1
lib/gitlab/ci/config/loader.rb
lib/gitlab/ci/config/loader.rb
+1
-1
spec/lib/gitlab/ci/config/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