Sha256: 6088b59a36985ce2d49eee6524c05435372d84f991243dec61a009360031ecc6

Contents?: true

Size: 1.58 KB

Versions: 25

Compression:

Stored size: 1.58 KB

Contents

require 'spec_helper'

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

  before :each do
    @hosts = make_hosts()
  end

  it "uses the virtualbox 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 virtualbox" ).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 :virtualbox do |vb|\n      vb.customize ['modifyvm', :id, '--memory', '1024']\n    end})
  end

  it "can disable the vb guest plugin" do
    options.merge!({ :vbguest_plugin => 'disable' })

    vfile_section = vagrant.class.provider_vfile_section( @hosts.first, options )

    match = vfile_section.match(/vb.vbguest.auto_update = false/)

    expect( match ).to_not be nil

  end

end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
beaker-2.18.1 spec/beaker/hypervisor/vagrant_virtualbox_spec.rb
beaker-2.18.0 spec/beaker/hypervisor/vagrant_virtualbox_spec.rb
beaker-2.17.0 spec/beaker/hypervisor/vagrant_virtualbox_spec.rb
beaker-2.16.0 spec/beaker/hypervisor/vagrant_virtualbox_spec.rb
beaker-2.15.1 spec/beaker/hypervisor/vagrant_virtualbox_spec.rb
beaker-2.15.0 spec/beaker/hypervisor/vagrant_virtualbox_spec.rb
beaker-2.14.1 spec/beaker/hypervisor/vagrant_virtualbox_spec.rb
beaker-2.14.0 spec/beaker/hypervisor/vagrant_virtualbox_spec.rb
beaker-2.13.0 spec/beaker/hypervisor/vagrant_virtualbox_spec.rb
beaker-2.12.0 spec/beaker/hypervisor/vagrant_virtualbox_spec.rb
beaker-2.11.0 spec/beaker/hypervisor/vagrant_virtualbox_spec.rb
beaker-2.10.0 spec/beaker/hypervisor/vagrant_virtualbox_spec.rb
beaker-2.9.0 spec/beaker/hypervisor/vagrant_virtualbox_spec.rb
beaker-2.8.0 spec/beaker/hypervisor/vagrant_virtualbox_spec.rb
beaker-2.7.1 spec/beaker/hypervisor/vagrant_virtualbox_spec.rb
beaker-2.7.0 spec/beaker/hypervisor/vagrant_virtualbox_spec.rb
beaker-2.6.0 spec/beaker/hypervisor/vagrant_virtualbox_spec.rb
beaker-2.5.1 spec/beaker/hypervisor/vagrant_virtualbox_spec.rb
beaker-2.5.0 spec/beaker/hypervisor/vagrant_virtualbox_spec.rb
beaker-2.4.1 spec/beaker/hypervisor/vagrant_virtualbox_spec.rb