Sha256: bcd117c689d6cbcd94c97b3bf5eed3b5bfb59ce6caabf85c6f27c8d5c07bec51

Contents?: true

Size: 1.29 KB

Versions: 94

Compression:

Stored size: 1.29 KB

Contents

require 'spec_helper'

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

  before :each do
    @hosts = make_hosts()
  end

  it "uses the vmware_workstation 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_workstation" ).once
    vagrant.provision
  end

  it "can make a Vagranfile for a set of hosts" do
    path = vagrant.instance_variable_get( :@vagrant_path )
    allow( vagrant ).to receive( :randmac ).and_return( "0123456789" )

    vagrant.make_vfile( @hosts )

    vagrantfile = File.read( File.expand_path( File.join( path, "Vagrantfile")))
    expect( vagrantfile ).to include( %Q{    v.vm.provider :vmware_workstation do |v|\n      v.vmx['memsize'] = '1024'\n    end})
  end
end

Version data entries

94 entries across 94 versions & 2 rubygems

Version Path
beaker-vagrant-0.4.0 spec/beaker/hypervisor/vagrant_workstation_spec.rb
beaker-vagrant-0.3.0 spec/beaker/hypervisor/vagrant_workstation_spec.rb
beaker-vagrant-0.2.1 spec/beaker/hypervisor/vagrant_workstation_spec.rb
beaker-vagrant-0.2.0 spec/beaker/hypervisor/vagrant_workstation_spec.rb
beaker-vagrant-0.1.1 spec/beaker/hypervisor/vagrant_workstation_spec.rb
beaker-vagrant-0.1.0 spec/beaker/hypervisor/vagrant_workstation_spec.rb
beaker-3.20.0 spec/beaker/hypervisor/vagrant_workstation_spec.rb
beaker-3.19.0 spec/beaker/hypervisor/vagrant_workstation_spec.rb
beaker-3.18.0 spec/beaker/hypervisor/vagrant_workstation_spec.rb
beaker-3.17.0 spec/beaker/hypervisor/vagrant_workstation_spec.rb
beaker-3.16.0 spec/beaker/hypervisor/vagrant_workstation_spec.rb
beaker-3.15.0 spec/beaker/hypervisor/vagrant_workstation_spec.rb
beaker-3.14.0 spec/beaker/hypervisor/vagrant_workstation_spec.rb
beaker-3.13.0 spec/beaker/hypervisor/vagrant_workstation_spec.rb
beaker-3.12.0 spec/beaker/hypervisor/vagrant_workstation_spec.rb
beaker-3.11.0 spec/beaker/hypervisor/vagrant_workstation_spec.rb
beaker-3.10.0 spec/beaker/hypervisor/vagrant_workstation_spec.rb
beaker-3.9.0 spec/beaker/hypervisor/vagrant_workstation_spec.rb
beaker-3.8.0 spec/beaker/hypervisor/vagrant_workstation_spec.rb
beaker-3.7.0 spec/beaker/hypervisor/vagrant_workstation_spec.rb