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
1d54e5f0
Commit
1d54e5f0
authored
Apr 28, 2020
by
Kerri Miller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add spec testing owner_line parsing
parent
cb3ca8c6
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
4 deletions
+9
-4
ee/spec/lib/gitlab/code_owners/file_spec.rb
ee/spec/lib/gitlab/code_owners/file_spec.rb
+9
-4
No files found.
ee/spec/lib/gitlab/code_owners/file_spec.rb
View file @
1d54e5f0
...
...
@@ -69,10 +69,10 @@ describe Gitlab::CodeOwners::File do
expect
(
data
.
keys
).
to
contain_exactly
(
"codeowners"
,
"Documentation"
,
"Database"
)
end
where
(
:section
,
:patterns
)
do
"codeowners"
|
[
"/**/ee/**/*"
]
"Documentation"
|
[
"/**/README.md"
,
"/**/ee/docs"
,
"/**/docs"
]
"Database"
|
[
"/**/README.md"
,
"/**/model/db"
]
where
(
:section
,
:patterns
,
:owners
)
do
"codeowners"
|
[
"/**/ee/**/*"
]
|
[
"@gl-admin"
]
"Documentation"
|
[
"/**/README.md"
,
"/**/ee/docs"
,
"/**/docs"
]
|
[
"@gl-docs"
]
"Database"
|
[
"/**/README.md"
,
"/**/model/db"
]
|
[
"@gl-database"
]
end
with_them
do
...
...
@@ -80,6 +80,11 @@ describe Gitlab::CodeOwners::File do
expect
(
file
.
parsed_data
[
section
].
keys
).
to
contain_exactly
(
*
patterns
)
expect
(
file
.
parsed_data
[
section
].
values
.
detect
{
|
entry
|
entry
.
section
!=
section
}).
to
be_nil
end
it
"assigns the correct owners for each entry"
do
extracted_owners
=
file
.
parsed_data
[
section
].
values
.
collect
(
&
:owner_line
).
uniq
expect
(
extracted_owners
).
to
contain_exactly
(
*
owners
)
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