Sha256: f40b3620079554ab198ef4be28ca6d7a735090773b6146c4fcdc457c1ddabb34

Contents?: true

Size: 1.29 KB

Versions: 3

Compression:

Stored size: 1.29 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']
      vagrant.should_receive( :set_ssh_config ).with( host, 'vagrant' ).once
      vagrant.should_receive( :copy_ssh_to_root ).with( host, options ).once
      vagrant.should_receive( :set_ssh_config ).with( host, host_prev_name ).once
    end
    vagrant.should_receive( :hack_etc_hosts ).with( @hosts, options ).once
    FakeFS.activate!
    vagrant.should_receive( :vagrant_cmd ).with( "up --provider virtualbox" ).once
    vagrant.provision
  end

  it "can make a Vagranfile for a set of hosts" do
    FakeFS.activate!
    path = vagrant.instance_variable_get( :@vagrant_path )
    vagrant.stub( :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
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
beaker-1.21.0 spec/beaker/hypervisor/vagrant_virtualbox_spec.rb
beaker-1.20.1 spec/beaker/hypervisor/vagrant_virtualbox_spec.rb
beaker-1.20.0 spec/beaker/hypervisor/vagrant_virtualbox_spec.rb