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 @@
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
{
DATABASE_SECRET
:
'passw0rd'
,
API_TOKEN
:
'passw0rd2'
,
API_TOKEN
:
'passw0rd2'
}
end
let
(
:config
)
{
valid_config
}
shared_examples
'composes a hash'
do
describe
'#valid?'
do
it
'is valid'
do
expect
(
entry
).
to
be_valid
end
context
'is invalid'
do
let
(
:config
)
{
%w[one two]
}
it
{
expect
(
entry
).
not_to
be_valid
}
end
end
describe
'#value'
do
context
'when config is a hash'
do
it
'returns key value'
do
...
...
@@ -32,7 +32,7 @@ RSpec.describe Gitlab::Config::Entry::ComposableHash, :aggregate_failures do
end
end
end
describe
'#compose!'
do
before
do
entry
.
compose!
...
...
@@ -74,12 +74,12 @@ RSpec.describe Gitlab::Config::Entry::ComposableHash, :aggregate_failures do
before
do
allow
(
entry
).
to
receive
(
:composable_class
).
and_return
(
Gitlab
::
Config
::
Entry
::
Node
)
end
it_behaves_like
'composes a hash'
end
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
include
::
Gitlab
::
Config
::
Entry
::
Configurable
...
...
@@ -88,16 +88,16 @@ RSpec.describe Gitlab::Config::Entry::ComposableHash, :aggregate_failures do
inherit:
false
,
default:
{
hello: :world
},
metadata:
{
composable_class:
Gitlab
::
Config
::
Entry
::
Node
}
end
end
end
let
(
:entry
)
do
parent_entry
=
composable_hash_parent_class
.
new
(
secrets:
config
)
parent_entry
.
compose!
parent_entry
[
:secrets
]
end
it_behaves_like
'composes a hash'
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