Sha256: 91bbe2e24cd24e43e2a97fc100cff791409f1d16fabad627182c019fdd3be03b

Contents?: true

Size: 635 Bytes

Versions: 2

Compression:

Stored size: 635 Bytes

Contents

require 'spec_helper'

describe Chef::Sugar::Virtualization do
  it_behaves_like 'a chef sugar'

  describe '#lxc?' do
    it 'returns true when the machine is a linux contianer' do
      node = { 'virtualization' => { 'system' => 'lxc' } }
      expect(described_class.lxc?(node)).to be_truthy
    end

    it 'returns false when the virtual machine is not lxc' do
      node = { 'virtualization' => { 'system' => 'vbox' } }
      expect(described_class.lxc?(node)).to be_falsey
    end

    it 'returns false when the machine is not virtual' do
      node = {}
      expect(described_class.lxc?(node)).to be_falsey
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
chef-sugar-2.2.0 spec/unit/chef/sugar/virtualization_spec.rb
chef-sugar-2.1.0 spec/unit/chef/sugar/virtualization_spec.rb