using retriable gem

This commit is contained in:
Andrew Waage
2016-10-19 14:30:43 -07:00
parent 4f9cfdd337
commit 77ecafa978
3 changed files with 36 additions and 33 deletions

View File

@@ -29,9 +29,9 @@ describe GitHubChangelogGenerator::OctoFetcher do
context "when raises Octokit::Forbidden" do
it "sleeps and retries and then aborts" do
retry_limit = GitHubChangelogGenerator::OctoFetcher::MAX_FORBIDDEN_RETRIES - 1
allow(fetcher).to receive(:sleep_base_interval).and_return(0)
expect(fetcher).to receive(:sys_abort).with("Exceeded retry limit")
expect(fetcher).to receive(:sys_sleep).exactly(retry_limit).times
fetcher.send(:check_github_response) { raise(Octokit::Forbidden) }
end
end