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
7398edf6
Commit
7398edf6
authored
Oct 06, 2020
by
allison.browne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix static errors
parent
56ccff6b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
13 deletions
+13
-13
spec/lib/gitlab/config/entry/composable_hash_spec.rb
spec/lib/gitlab/config/entry/composable_hash_spec.rb
+13
-13
No files found.
spec/lib/gitlab/config/entry/composable_hash_spec.rb
View file @
7398edf6
...
@@ -2,29 +2,29 @@
...
@@ -2,29 +2,29 @@
require
'spec_helper'
require
'spec_helper'
RSpec
.
describe
Gitlab
::
Config
::
Entry
::
ComposableHash
,
:aggregate_failures
do
RSpec
.
describe
Gitlab
::
Config
::
Entry
::
ComposableHash
,
:aggregate_failures
do
let
(
:valid_config
)
do
let
(
:valid_config
)
do
{
{
DATABASE_SECRET
:
'passw0rd'
,
DATABASE_SECRET
:
'passw0rd'
,
API_TOKEN
:
'passw0rd2'
,
API_TOKEN
:
'passw0rd2'
}
}
end
end
let
(
:config
)
{
valid_config
}
let
(
:config
)
{
valid_config
}
shared_examples
'composes a hash'
do
shared_examples
'composes a hash'
do
describe
'#valid?'
do
describe
'#valid?'
do
it
'is valid'
do
it
'is valid'
do
expect
(
entry
).
to
be_valid
expect
(
entry
).
to
be_valid
end
end
context
'is invalid'
do
context
'is invalid'
do
let
(
:config
)
{
%w[one two]
}
let
(
:config
)
{
%w[one two]
}
it
{
expect
(
entry
).
not_to
be_valid
}
it
{
expect
(
entry
).
not_to
be_valid
}
end
end
end
end
describe
'#value'
do
describe
'#value'
do
context
'when config is a hash'
do
context
'when config is a hash'
do
it
'returns key value'
do
it
'returns key value'
do
...
@@ -32,7 +32,7 @@ RSpec.describe Gitlab::Config::Entry::ComposableHash, :aggregate_failures do
...
@@ -32,7 +32,7 @@ RSpec.describe Gitlab::Config::Entry::ComposableHash, :aggregate_failures do
end
end
end
end
end
end
describe
'#compose!'
do
describe
'#compose!'
do
before
do
before
do
entry
.
compose!
entry
.
compose!
...
@@ -74,12 +74,12 @@ RSpec.describe Gitlab::Config::Entry::ComposableHash, :aggregate_failures do
...
@@ -74,12 +74,12 @@ RSpec.describe Gitlab::Config::Entry::ComposableHash, :aggregate_failures do
before
do
before
do
allow
(
entry
).
to
receive
(
:composable_class
).
and_return
(
Gitlab
::
Config
::
Entry
::
Node
)
allow
(
entry
).
to
receive
(
:composable_class
).
and_return
(
Gitlab
::
Config
::
Entry
::
Node
)
end
end
it_behaves_like
'composes a hash'
it_behaves_like
'composes a hash'
end
end
context
'when ComposableHash entry is configured in the parent class'
do
context
'when ComposableHash entry is configured in the parent class'
do
let
(
:composable_hash_parent_class
)
do
let
(
:composable_hash_parent_class
)
do
Class
.
new
(
Gitlab
::
Config
::
Entry
::
Node
)
do
Class
.
new
(
Gitlab
::
Config
::
Entry
::
Node
)
do
include
::
Gitlab
::
Config
::
Entry
::
Configurable
include
::
Gitlab
::
Config
::
Entry
::
Configurable
...
@@ -88,16 +88,16 @@ RSpec.describe Gitlab::Config::Entry::ComposableHash, :aggregate_failures do
...
@@ -88,16 +88,16 @@ RSpec.describe Gitlab::Config::Entry::ComposableHash, :aggregate_failures do
inherit:
false
,
inherit:
false
,
default:
{
hello: :world
},
default:
{
hello: :world
},
metadata:
{
composable_class:
Gitlab
::
Config
::
Entry
::
Node
}
metadata:
{
composable_class:
Gitlab
::
Config
::
Entry
::
Node
}
end
end
end
end
let
(
:entry
)
do
let
(
:entry
)
do
parent_entry
=
composable_hash_parent_class
.
new
(
secrets:
config
)
parent_entry
=
composable_hash_parent_class
.
new
(
secrets:
config
)
parent_entry
.
compose!
parent_entry
.
compose!
parent_entry
[
:secrets
]
parent_entry
[
:secrets
]
end
end
it_behaves_like
'composes a hash'
it_behaves_like
'composes a hash'
it
'creates entry with configuration from parent class'
do
it
'creates entry with configuration from parent class'
do
...
...
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