Skip to content

Commit

Permalink
judjes-action#156: add pull requests to Fbe::FakeOctokit#search_issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Yegorov committed Jul 30, 2024
1 parent cd3234c commit 658e83d
Showing 1 changed file with 44 additions and 13 deletions.
57 changes: 44 additions & 13 deletions lib/fbe/octo.rb
Original file line number Diff line number Diff line change
Expand Up @@ -301,19 +301,50 @@ def create_commit_comment(_repo, sha, text)
}
end

def search_issues(_query, _options = {})
{
items: [
{
number: 42,
labels: [
{
name: 'bug'
}
]
}
]
}
def search_issues(query, _options = {})
if query.include?('type:pr') && query.include?('is:unmerged')
{
total_count: 1,
incomplete_results: false,
items: [
{
id: 42,
number: 10,
title: 'Awesome PR 10'
}
]
}
elsif query.include?('type:pr')
{
total_count: 2,
incomplete_results: false,
items: [
{
id: 42,
number: 10,
title: 'Awesome PR 10'
},
{
id: 43,
number: 11,
title: 'Awesome PR 11'
}
]
}
else
{
items: [
{
number: 42,
labels: [
{
name: 'bug'
}
]
}
]
}
end
end

def commits_since(repo, _since)
Expand Down

0 comments on commit 658e83d

Please sign in to comment.