Sha256: f5f927b715060a1492eeff777bdf56f276390d88e21e5af6d431b730d7241c9b
Contents?: true
Size: 1.51 KB
Versions: 29
Compression:
Stored size: 1.51 KB
Contents
require 'spec_helper' describe Beaker::VagrantLibvirt do let( :options ) { make_opts.merge({ :hosts_file => 'sample.cfg', 'logger' => double().as_null_object }) } let( :vagrant ) { Beaker::VagrantLibvirt.new( @hosts, options ) } before :each do @hosts = make_hosts() end it "uses the vagrant_libvirt 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 FakeFS.activate! expect( vagrant ).to receive( :vagrant_cmd ).with( "up --provider libvirt" ).once vagrant.provision end context 'Correct vagrant configuration' do before(:each) do FakeFS.activate! 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"))) end it "can make a Vagranfile for a set of hosts" do expect( @vagrantfile ).to include( %Q{ v.vm.provider :libvirt do |node|}) end it "can specify the memory as an integer" do expect( @vagrantfile.split("\n").map(&:strip) ) .to include('node.memory = 512') end end end
Version data entries
29 entries across 29 versions & 1 rubygems