Skip to content

Commit f257168

Browse files
committed
add owner overrides
1 parent bf8c52b commit f257168

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

lua/gh-co/co.test.lua

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,4 +290,23 @@ function TestCO:testAppsWithEmptyGithubSubdirectory() -- luacheck: ignore 212
290290
lu.assertEquals(githubResult, {})
291291
end
292292

293+
function TestCO:testAppsWithGithubSubdirectoryOwner() -- luacheck: ignore 212
294+
-- Test /apps/ with /apps/github having different owner
295+
self.FS.openCodeownersFileAsLines = function()
296+
local lines = {
297+
"/apps/ @octocat",
298+
"/apps/github @doctocat"
299+
}
300+
local i = 0
301+
return function()
302+
i = i + 1
303+
return lines[i]
304+
end
305+
end
306+
307+
-- Files in /apps/github should have @doctocat (overrides /apps/)
308+
local githubResult = CO.matchFilesToCodeowner({"/apps/github/readme.md"})
309+
lu.assertEquals(githubResult, {"@doctocat"})
310+
end
311+
293312
os.exit(lu.LuaUnit.run())

0 commit comments

Comments
 (0)