Sha256: 3ffa0416d166a93af8f89fba31d15ea304e4df80c78bdf469487f44a0abd8e04

Contents?: true

Size: 1.01 KB

Versions: 7

Compression:

Stored size: 1.01 KB

Contents

# frozen_string_literal: true

module FogExtensions
  module Vsphere
    module Snapshots
      module Mock
        # Overwrite this to stop infinite recursion
        # TODO: Add proper test data
        def list_child_snapshots(_snapshot, _opts = {})
          []
        end

        def remove_snapshot(options = {})
          raise ArgumentError, 'snapshot is a required parameter' unless options.key? 'snapshot'
          raise ArgumentError, 'removeChildren is a required parameter' unless options.key? 'removeChildren'

          {
            'task_state' => 'success'
          }
        end

        def rename_snapshot(options = {})
          raise ArgumentError, 'snapshot is a required parameter' unless options.key? 'snapshot'
          raise ArgumentError, 'name is a required parameter' unless options.key? 'name'
          raise ArgumentError, 'description is a required parameter' unless options.key? 'description'

          {
            'task_state' => 'success'
          }
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
foreman_snapshot_management-2.0.3 app/models/concerns/fog_extensions/vsphere/snapshots/mock.rb
foreman_snapshot_management-2.0.2 app/models/concerns/fog_extensions/vsphere/snapshots/mock.rb
foreman_snapshot_management-2.0.1 app/models/concerns/fog_extensions/vsphere/snapshots/mock.rb
foreman_snapshot_management-2.0.0 app/models/concerns/fog_extensions/vsphere/snapshots/mock.rb
foreman_snapshot_management-1.7.1 app/models/concerns/fog_extensions/vsphere/snapshots/mock.rb
foreman_snapshot_management-1.7.0 app/models/concerns/fog_extensions/vsphere/snapshots/mock.rb
foreman_snapshot_management-1.6.1 app/models/concerns/fog_extensions/vsphere/snapshots/mock.rb