File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed
sync-team/src/github/tests Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -624,11 +624,15 @@ impl GithubRead for GithubMock {
624624
625625 fn repo_rulesets (
626626 & self ,
627- _org : & str ,
628- _repo : & str ,
627+ org : & str ,
628+ repo : & str ,
629629 ) -> anyhow:: Result < Vec < crate :: github:: api:: Ruleset > > {
630- // Return empty list for tests - rulesets not used in mock tests yet
631- Ok ( Vec :: new ( ) )
630+ Ok ( self
631+ . get_org ( org)
632+ . rulesets
633+ . get ( repo)
634+ . cloned ( )
635+ . unwrap_or_default ( ) )
632636 }
633637
634638 fn repo_environments (
@@ -660,6 +664,8 @@ struct GithubOrg {
660664 repo_members : HashMap < String , RepoMembers > ,
661665 // Repo name -> Vec<(protection ID, branch protection)>
662666 branch_protections : HashMap < String , Vec < ( String , BranchProtection ) > > ,
667+ // Repo name -> Vec<ruleset>
668+ rulesets : HashMap < String , Vec < crate :: github:: api:: Ruleset > > ,
663669 // Repo name -> HashMap<env name, environment>
664670 repo_environments : HashMap < String , HashMap < String , Environment > > ,
665671}
You can’t perform that action at this time.
0 commit comments