Sha256: aa880b467ac3da2a71651ba4086aff4a667b52165c532299f41030b02a989362

Contents?: true

Size: 1.17 KB

Versions: 14

Compression:

Stored size: 1.17 KB

Contents

# frozen_string_literal: true

# Copyright 2018 Tristan Robert

# This file is part of ForemanFogProxmox.

# ForemanFogProxmox is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.

# ForemanFogProxmox is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.

# You should have received a copy of the GNU General Public License
# along with ForemanFogProxmox. If not, see <http://www.gnu.org/licenses/>.

require 'test_plugin_helper'

module ForemanFogProxmox
  class ProxmoxVmUuidHelperTest < ActiveSupport::TestCase
    include ProxmoxVmUuidHelper

    describe 'extract_vmid' do
      setup { Fog.mock! }
      teardown { Fog.unmock! }

      it '#uuid=1_100 returns 100' do
        assert_equal '100', extract_vmid('1_100')
      end
      it '#uuid=pve_100 returns ' do
        assert_equal '', extract_vmid('pve_100')
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
foreman_fog_proxmox-0.16.3 test/unit/foreman_fog_proxmox/helpers/proxmox_vm_uuid_helper_test.rb
foreman_fog_proxmox-0.16.2 test/unit/foreman_fog_proxmox/helpers/proxmox_vm_uuid_helper_test.rb
foreman_fog_proxmox-0.16.1 test/unit/foreman_fog_proxmox/helpers/proxmox_vm_uuid_helper_test.rb
foreman_fog_proxmox-0.16.0 test/unit/foreman_fog_proxmox/helpers/proxmox_vm_uuid_helper_test.rb
foreman_fog_proxmox-0.15.1 test/unit/foreman_fog_proxmox/helpers/proxmox_vm_uuid_helper_test.rb
foreman_fog_proxmox-0.15.0 test/unit/foreman_fog_proxmox/helpers/proxmox_vm_uuid_helper_test.rb
foreman_fog_proxmox-0.14.3 test/unit/foreman_fog_proxmox/helpers/proxmox_vm_uuid_helper_test.rb
foreman_fog_proxmox-0.14.2 test/unit/foreman_fog_proxmox/helpers/proxmox_vm_uuid_helper_test.rb
foreman_fog_proxmox-0.14.1 test/unit/foreman_fog_proxmox/helpers/proxmox_vm_uuid_helper_test.rb
foreman_fog_proxmox-0.14.0 test/unit/foreman_fog_proxmox/helpers/proxmox_vm_uuid_helper_test.rb
foreman_fog_proxmox-0.13.4 test/unit/foreman_fog_proxmox/helpers/proxmox_vm_uuid_helper_test.rb
foreman_fog_proxmox-0.13.3 test/unit/foreman_fog_proxmox/helpers/proxmox_vm_uuid_helper_test.rb
foreman_fog_proxmox-0.13.2 test/unit/foreman_fog_proxmox/helpers/proxmox_vm_uuid_helper_test.rb
foreman_fog_proxmox-0.13.1 test/unit/foreman_fog_proxmox/helpers/proxmox_vm_uuid_helper_test.rb