mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
[rackspace|storage] fixing broken tests
This commit is contained in:
parent
f7b8e9b0dc
commit
65eba751da
3 changed files with 18 additions and 5 deletions
|
@ -15,7 +15,22 @@ module Fog
|
|||
request :put_container
|
||||
request :delete_object
|
||||
|
||||
module Base
|
||||
private
|
||||
|
||||
def authentication_method
|
||||
if @rackspace_auth_url && @rackspace_auth_url =~ /v1(\.\d)?\w*$/
|
||||
:authenticate_v1
|
||||
else
|
||||
:authenticate_v2
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
||||
class Mock
|
||||
include Base
|
||||
|
||||
def self.data
|
||||
@data ||= Hash.new do |hash, key|
|
||||
|
@ -47,6 +62,7 @@ module Fog
|
|||
end
|
||||
|
||||
class Real
|
||||
include Base
|
||||
|
||||
def initialize(options={})
|
||||
@connection_options = options[:connection_options] || {}
|
||||
|
|
|
@ -1,9 +1,7 @@
|
|||
Shindo.tests('Fog::CDN::Rackspace', ['rackspace']) do
|
||||
|
||||
pending if Fog.mocking?
|
||||
|
||||
def assert_method(url, method)
|
||||
@service.instance_variable_set "@rackspace_auth_url", method
|
||||
@service.instance_variable_set "@rackspace_auth_url", url
|
||||
returns(method) { @service.send :authentication_method }
|
||||
end
|
||||
|
||||
|
@ -42,7 +40,6 @@ Shindo.tests('Fog::CDN::Rackspace', ['rackspace']) do
|
|||
end
|
||||
tests('dfw region') do
|
||||
@service = Fog::CDN::Rackspace.new :rackspace_auth_url => 'https://identity.api.rackspacecloud.com/v2.0', :rackspace_region => :dfw
|
||||
puts @service.instance_variable_get("@host")
|
||||
returns(true) { (@service.instance_variable_get("@host") =~ /cdn1/) != nil }
|
||||
end
|
||||
tests('ord region') do
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
Shindo.tests('Rackspace | Storage', ['rackspace']) do
|
||||
|
||||
def assert_method(url, method)
|
||||
@service.instance_variable_set "@rackspace_auth_url", method
|
||||
@service.instance_variable_set "@rackspace_auth_url", url
|
||||
returns(method) { @service.send :authentication_method }
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue