spec/beaker/hypervisor/vagrant_virtualbox_spec.rb in beaker-1.21.0 vs spec/beaker/hypervisor/vagrant_virtualbox_spec.rb in beaker-2.0.0

- old
+ new

@@ -9,26 +9,36 @@ 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 + 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 - vagrant.should_receive( :hack_etc_hosts ).with( @hosts, options ).once - FakeFS.activate! - vagrant.should_receive( :vagrant_cmd ).with( "up --provider virtualbox" ).once + 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 - FakeFS.activate! path = vagrant.instance_variable_get( :@vagrant_path ) - vagrant.stub( :randmac ).and_return( "0123456789" ) + 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