Added tests for repository

This commit is contained in:
Senad Uka
2018-08-13 20:40:50 +02:00
parent 696d02a97c
commit e64d7509cd
4 changed files with 120 additions and 10 deletions

View File

@@ -20,14 +20,14 @@ module Pruning
with_retries(max_tries: NUMBER_OF_RETRIES, rescue: [Pruning::Exceptions::ServerErrorOnOrigin]) do
begin
resp = @client.get(url(name))
rescue RestClient::ExceptionWithResponse => e
raise Pruning::Exceptions::ServerErrorOnOrigin if e.response.code != 404
raise Pruning::Exceptions::OriginCannotFindTheResource
end
return JSON(resp.body)
rescue RestClient::ExceptionWithResponse => e
raise Pruning::Exceptions::ServerErrorOnOrigin if e.response.code != 404
raise Pruning::Exceptions::OriginCannotFindTheResource
end
raise Pruning::Exceptions::UnexpectedError
return JSON(resp.body)
end
raise Pruning::Exceptions::UnexpectedError
end