diff --git a/spec/unit/octo_fetcher_spec.rb b/spec/unit/octo_fetcher_spec.rb index a4398b1..f2dbdeb 100644 --- a/spec/unit/octo_fetcher_spec.rb +++ b/spec/unit/octo_fetcher_spec.rb @@ -29,7 +29,7 @@ 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) + allow(fetcher).to receive(:sleep_base_interval).exactly(retry_limit).times.and_return(0) expect(fetcher).to receive(:sys_abort).with("Exceeded retry limit") fetcher.send(:check_github_response) { raise(Octokit::Forbidden) }