mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
Remove duplicate Mock class definition
This commit is contained in:
parent
ebe7af8f94
commit
a3c92dcd6a
1 changed files with 9 additions and 27 deletions
|
@ -123,32 +123,6 @@ module Fog
|
|||
request :update_resource_count
|
||||
request :update_virtual_machine
|
||||
|
||||
class Mock
|
||||
|
||||
def self.data
|
||||
@data ||= Hash.new do |hash, key|
|
||||
hash[key] = {}
|
||||
end
|
||||
end
|
||||
|
||||
def self.reset
|
||||
@data = nil
|
||||
end
|
||||
|
||||
def initialize(options={})
|
||||
@cloudstack_api_key = options[:cloudstack_api_key]
|
||||
end
|
||||
|
||||
def data
|
||||
self.class.data[@cloudstack_api_key]
|
||||
end
|
||||
|
||||
def reset_data
|
||||
self.class.data.delete(@cloudstack_api_key)
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
class Real
|
||||
|
||||
def initialize(options={})
|
||||
|
@ -267,6 +241,10 @@ module Fog
|
|||
end # Real
|
||||
|
||||
class Mock
|
||||
def initialize(options={})
|
||||
@cloudstack_api_key = options[:cloudstack_api_key]
|
||||
end
|
||||
|
||||
def self.data
|
||||
@data ||= begin
|
||||
rc_options = Fog.credentials[:cloudstack] || {}
|
||||
|
@ -437,12 +415,16 @@ module Fog
|
|||
end
|
||||
|
||||
def self.reset
|
||||
@data= nil
|
||||
@data = nil
|
||||
end
|
||||
|
||||
def data
|
||||
self.class.data
|
||||
end
|
||||
|
||||
def reset_data
|
||||
self.class.data.delete(@cloudstack_api_key)
|
||||
end
|
||||
end
|
||||
end # Cloudstack
|
||||
end # Compute
|
||||
|
|
Loading…
Reference in a new issue