mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
Add a reset method to Fog::Mock that resets all providers/services.
This commit is contained in:
parent
d0e428667e
commit
5fcf3185ca
1 changed files with 10 additions and 0 deletions
|
@ -63,6 +63,16 @@ module Fog
|
|||
selection
|
||||
end
|
||||
|
||||
def self.reset
|
||||
providers = Fog.providers.map{|p| eval("Fog::#{p}")}
|
||||
providers.select!{|m| m.constants.include?(:Compute)}
|
||||
|
||||
providers.each do |provider|
|
||||
next unless provider::Compute::Mock.respond_to?(:reset)
|
||||
provider::Compute::Mock.reset
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
Loading…
Reference in a new issue