From e3663e7f907715e99af3b72e71efb62cb9c72085 Mon Sep 17 00:00:00 2001 From: Arjit Jaiswal Date: Fri, 7 Jul 2023 12:59:49 -0700 Subject: [PATCH] Add testing for the strings in the actual error message that propagates from Octokit::TooManyRequests --- spec/octokit/client_spec.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/octokit/client_spec.rb b/spec/octokit/client_spec.rb index e9ef0ad28..67e4fddb6 100644 --- a/spec/octokit/client_spec.rb +++ b/spec/octokit/client_spec.rb @@ -849,7 +849,7 @@ content_type: 'application/json' }, body: { message: 'API rate limit exceeded' }.to_json - expect { Octokit.get('/users/mojomobo') }.to raise_error Octokit::TooManyRequests + expect { Octokit.get('/users/mojomobo') }.to raise_error(Octokit::TooManyRequests, /API rate limit exceeded/) stub_get('/users/mojomobo').to_return \ status: 403, @@ -857,7 +857,7 @@ content_type: 'application/json' }, body: { message: 'You have exceeded a secondary rate limit.' }.to_json - expect { Octokit.get('/users/mojomobo') }.to raise_error Octokit::TooManyRequests + expect { Octokit.get('/users/mojomobo') }.to raise_error(Octokit::TooManyRequests, /You have exceeded a secondary rate limit./) stub_get('/user').to_return \ status: 403,