mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
[rackspace|queues] updated to use FOG::UUID
This commit is contained in:
parent
773104e9dc
commit
1a003b8537
2 changed files with 4 additions and 3 deletions
|
@ -1,5 +1,4 @@
|
|||
require File.expand_path(File.join(File.dirname(__FILE__), '..', 'rackspace'))
|
||||
require 'uuidtools'
|
||||
|
||||
module Fog
|
||||
module Rackspace
|
||||
|
@ -62,7 +61,7 @@ module Fog
|
|||
def initialize(options = {})
|
||||
@rackspace_api_key = options[:rackspace_api_key]
|
||||
@rackspace_username = options[:rackspace_username]
|
||||
@rackspace_queues_client_id = options[:rackspace_queues_client_id] || UUIDTools::UUID.random_create.to_s
|
||||
@rackspace_queues_client_id = options[:rackspace_queues_client_id] || Fog::UUID.uuid
|
||||
@rackspace_auth_url = options[:rackspace_auth_url]
|
||||
@rackspace_must_reauthenticate = false
|
||||
@connection_options = options[:connection_options] || {}
|
||||
|
|
|
@ -102,11 +102,13 @@ Shindo.tests('Fog::Rackspace::Queues', ['rackspace']) do
|
|||
pending if Fog.mocking?
|
||||
|
||||
tests('should generate uuid if a client id is not provided').succeeds do
|
||||
pending unless Fog::UUID.supported?
|
||||
service = Fog::Rackspace::Queues.new
|
||||
service.client_id =~ /[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/
|
||||
end
|
||||
tests('should use specified uuid').succeeds do
|
||||
my_uuid = UUIDTools::UUID.random_create.to_s
|
||||
pending unless Fog::UUID.supported?
|
||||
my_uuid = Fog::UUID.uuid
|
||||
service = Fog::Rackspace::Queues.new :rackspace_queues_client_id => my_uuid
|
||||
service.client_id == my_uuid
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue