diff --git a/updater/spec/dependabot/file_fetcher_job_spec.rb b/updater/spec/dependabot/file_fetcher_job_spec.rb index 1e8c1b03c0a..99759a8a913 100644 --- a/updater/spec/dependabot/file_fetcher_job_spec.rb +++ b/updater/spec/dependabot/file_fetcher_job_spec.rb @@ -69,7 +69,7 @@ ) expect(api_client).to receive(:mark_job_as_processed) - perform_job + expect { perform_job }.to output(/Error during file fetching; aborting/).to_stdout_from_any_process end end @@ -94,7 +94,7 @@ ) expect(api_client).to receive(:mark_job_as_processed) - perform_job + expect { perform_job }.to output(/Error during file fetching; aborting/).to_stdout_from_any_process end end @@ -123,7 +123,7 @@ ) expect(api_client).to receive(:mark_job_as_processed) - perform_job + expect { perform_job }.to output(/Repository is rate limited, attempting to retry/).to_stdout_from_any_process end end @@ -181,7 +181,7 @@ end expect(api_client).to receive(:mark_job_as_processed) - perform_job + expect { perform_job }.to output(/Something went wrong/).to_stdout_from_any_process expect(Dir.exist?(Dependabot::Environment.repo_contents_path)).to be_truthy expect(Dir.empty?(Dependabot::Environment.repo_contents_path)).to be_truthy diff --git a/updater/spec/dependabot/integration_spec.rb b/updater/spec/dependabot/integration_spec.rb index bd2fbc68c15..333ebd75f3a 100644 --- a/updater/spec/dependabot/integration_spec.rb +++ b/updater/spec/dependabot/integration_spec.rb @@ -175,18 +175,18 @@ expect(api_client).to receive(:record_update_job_error). with(job_id, { error_type: "unknown_error", error_details: nil }) - end_to_end_job.run + expect { end_to_end_job.run }.to output(/oh no!/).to_stdout_from_any_process end it "indicates there was an error in the summary" do expect(Dependabot.logger).not_to receive(:info).with(/Changes to Dependabot Pull Requests/) expect(Dependabot.logger).to receive(:info).with(/Dependabot encountered '1' error/) - end_to_end_job.run + expect { end_to_end_job.run }.to output(/oh no!/).to_stdout_from_any_process end it "does not raise an exception" do - expect { end_to_end_job.run }.not_to raise_error + expect { end_to_end_job.run }.to output(/oh no!/).to_stdout_from_any_process end context "when GITHUB_ACTIONS is set" do @@ -195,7 +195,8 @@ end it "raises an exception" do - expect { end_to_end_job.run }.to raise_error(Dependabot::RunFailure) + expect { end_to_end_job.run }.to raise_error(Dependabot::RunFailure). + and output(/oh no!/).to_stdout_from_any_process end end end