mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
[rackspace|dns] fix mock init to play nice with tests
This commit is contained in:
parent
2c82662609
commit
ae7294bdfd
1 changed files with 26 additions and 1 deletions
|
@ -38,7 +38,32 @@ module Fog
|
||||||
class Mock
|
class Mock
|
||||||
|
|
||||||
def initialize(options={})
|
def initialize(options={})
|
||||||
Fog::Mock.not_implemented
|
@rackspace_api_key = options[:rackspace_api_key]
|
||||||
|
@rackspace_username = options[:rackspace_username]
|
||||||
|
@rackspace_auth_url = options[:rackspace_auth_url]
|
||||||
|
@connection_options = options[:connection_options] || {}
|
||||||
|
end
|
||||||
|
|
||||||
|
def self.data
|
||||||
|
@data ||= {
|
||||||
|
:zones => {}
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
def self.reset
|
||||||
|
@data = nil
|
||||||
|
end
|
||||||
|
|
||||||
|
def auth_token
|
||||||
|
@auth_token ||= Fog::Dynect::Mock.token
|
||||||
|
end
|
||||||
|
|
||||||
|
def data
|
||||||
|
self.class.data
|
||||||
|
end
|
||||||
|
|
||||||
|
def reset_data
|
||||||
|
self.class.reset
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue