lib/fog/azurerm/requests/resources/create_resource_group.rb in fog-azure-rm-0.0.2 vs lib/fog/azurerm/requests/resources/create_resource_group.rb in fog-azure-rm-0.0.3
- old
+ new
@@ -1,8 +1,9 @@
module Fog
module Resources
class AzureRM
+ # This class provides the actual implemention for service calls.
class Real
def create_resource_group(name, location)
begin
Fog::Logger.debug "Creating Resource Group: #{name}."
rg_properties = ::Azure::ARM::Resources::Models::ResourceGroup.new
@@ -16,19 +17,20 @@
raise msg
end
end
end
+ # This class provides the mock implementation for unit tests.
class Mock
def create_resource_group(name, location)
{
- "location" => location,
- "id" => "/subscriptions/########-####-####-####-############/resourceGroups/#{name}",
- "name" => name,
- "properties" =>
- {
- "provisioningState" => "Succeeded"
- }
+ 'location' => location,
+ 'id' => "/subscriptions/########-####-####-####-############/resourceGroups/#{name}",
+ 'name' => name,
+ 'properties' =>
+ {
+ 'provisioningState' => 'Succeeded'
+ }
}
end
end
end
end