Sha256: 89429d34725100818ae66d0bc768e834373806c9a5bf72ae328434446173c158

Contents?: true

Size: 1.86 KB

Versions: 3

Compression:

Stored size: 1.86 KB

Contents

require 'spec_helper'

describe Beaker::VagrantDesktop do
  let(:options) { make_opts.merge({ :hosts_file => 'sample.cfg', 'logger' => double.as_null_object }) }
  let(:vagrant) { described_class.new(hosts, options) }
  let(:hosts) { make_hosts }

  it 'uses the vmware_desktop provider for provisioning' do
    hosts.each do |host|
      host_prev_name = host['user']
      expect(vagrant).to receive(:set_ssh_config).with(host, 'vagrant').once
      expect(vagrant).to receive(:copy_ssh_to_root).with(host, options).once
      expect(vagrant).to receive(:set_ssh_config).with(host, host_prev_name).once
    end
    expect(vagrant).to receive(:hack_etc_hosts).with(hosts, options).once
    expect(vagrant).to receive(:vagrant_cmd).with('up --provider vmware_desktop').once
    FakeFS do
      vagrant.provision
    end
  end

  context 'can make a Vagrantfile' do
    subject do
      FakeFS do
        vagrant.make_vfile(hosts)
        File.read(vagrant.instance_variable_get(:@vagrant_file))
      end
    end

    it 'for a set of hosts' do
      is_expected.to include(%(    v.vm.provider :vmware_desktop do |v|\n      v.vmx['memsize'] = '1024'\n    end))
    end

    context 'with whitelist_verified' do
      let(:hosts) { make_hosts({ whitelist_verified: true }, 1) }

      it { is_expected.to include(%( v.vmx['whitelist_verified'] = 'true')) }
    end

    context 'with functional_hgfs' do
      let(:hosts) { make_hosts({ functional_hgfs: true }, 1) }

      it { is_expected.to include(%( v.vmx['functional_hgfs'] = 'true')) }
    end

    context 'with unmount_default_hgfs' do
      let(:hosts) { make_hosts({ unmount_default_hgfs: true }, 1) }

      it { is_expected.to include(%( v.vmx['unmount_default_hgfs'] = 'true')) }
    end

    context 'with gui' do
      let(:hosts) { make_hosts({ gui: true }, 1) }

      it { is_expected.to include(%( v.vmx['gui'] = true)) }
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
beaker-vagrant-1.2.0 spec/beaker/hypervisor/vagrant_desktop_spec.rb
beaker-vagrant-1.1.0 spec/beaker/hypervisor/vagrant_desktop_spec.rb
beaker-vagrant-1.0.0 spec/beaker/hypervisor/vagrant_desktop_spec.rb