lib/fog/rackspace/requests/queues/delete_claim.rb in fog-1.19.0 vs lib/fog/rackspace/requests/queues/delete_claim.rb in fog-1.20.0
- old
+ new
@@ -1,8 +1,9 @@
module Fog
module Rackspace
class Queues
+
class Real
# This operation immediately releases a claim, making any remaining, undeleted) messages that are associated with the claim available to other workers.
# Claims with malformed IDs or claims that are not found by ID are ignored.
#
@@ -20,8 +21,25 @@
:method => 'DELETE',
:path => "queues/#{queue_name}/claims/#{claim_id}"
)
end
end
+
+ class Mock
+ def delete_claim(queue_name, claim_id)
+ queue = mock_queue!(queue_name)
+ claim = queue.claim!(claim_id)
+
+ claim.messages.each do |message|
+ message.claim = nil
+ end
+ queue.claims.delete(claim_id)
+
+ response = Excon::Response.new
+ response.status = 204
+ response
+ end
+ end
+
end
end
end