spec/beaker/hypervisor/vagrant_spec.rb in beaker-1.19.1 vs spec/beaker/hypervisor/vagrant_spec.rb in beaker-1.20.0
- old
+ new
@@ -23,12 +23,49 @@
path = vagrant.instance_variable_get( :@vagrant_path )
vagrant.stub( :randmac ).and_return( "0123456789" )
vagrant.make_vfile( @hosts )
- expect( File.read( File.expand_path( File.join( path, "Vagrantfile") ) ) ).to be === "Vagrant.configure(\"2\") do |c|\n c.vm.define 'vm1' do |v|\n v.vm.hostname = 'vm1'\n v.vm.box = 'vm1_of_my_box'\n v.vm.box_url = 'http://address.for.my.box.vm1'\n v.vm.base_mac = '0123456789'\n v.vm.network :private_network, ip: \"ip.address.for.vm1\", :netmask => \"255.255.0.0\"\n end\n c.vm.define 'vm2' do |v|\n v.vm.hostname = 'vm2'\n v.vm.box = 'vm2_of_my_box'\n v.vm.box_url = 'http://address.for.my.box.vm2'\n v.vm.base_mac = '0123456789'\n v.vm.network :private_network, ip: \"ip.address.for.vm2\", :netmask => \"255.255.0.0\"\n end\n c.vm.define 'vm3' do |v|\n v.vm.hostname = 'vm3'\n v.vm.box = 'vm3_of_my_box'\n v.vm.box_url = 'http://address.for.my.box.vm3'\n v.vm.base_mac = '0123456789'\n v.vm.network :private_network, ip: \"ip.address.for.vm3\", :netmask => \"255.255.0.0\"\n end\n c.vm.provider :virtualbox do |vb|\n vb.customize [\"modifyvm\", :id, \"--memory\", \"1024\"]\n end\nend\n"
+ vagrantfile = File.read( File.expand_path( File.join( path, "Vagrantfile")))
+ expect( vagrantfile ).to be === <<-EOF
+Vagrant.configure("2") do |c|
+ c.vm.define 'vm1' do |v|
+ v.vm.hostname = 'vm1'
+ v.vm.box = 'vm1_of_my_box'
+ v.vm.box_url = 'http://address.for.my.box.vm1'
+ v.vm.box_check_update = 'true'
+ v.vm.base_mac = '0123456789'
+ v.vm.network :private_network, ip: "ip.address.for.vm1", :netmask => "255.255.0.0"
+ v.vm.provider :virtualbox do |vb|
+ vb.customize ['modifyvm', :id, '--memory', '1024']
end
+ end
+ c.vm.define 'vm2' do |v|
+ v.vm.hostname = 'vm2'
+ v.vm.box = 'vm2_of_my_box'
+ v.vm.box_url = 'http://address.for.my.box.vm2'
+ v.vm.box_check_update = 'true'
+ v.vm.base_mac = '0123456789'
+ v.vm.network :private_network, ip: "ip.address.for.vm2", :netmask => "255.255.0.0"
+ v.vm.provider :virtualbox do |vb|
+ vb.customize ['modifyvm', :id, '--memory', '1024']
+ end
+ end
+ c.vm.define 'vm3' do |v|
+ v.vm.hostname = 'vm3'
+ v.vm.box = 'vm3_of_my_box'
+ v.vm.box_url = 'http://address.for.my.box.vm3'
+ v.vm.box_check_update = 'true'
+ v.vm.base_mac = '0123456789'
+ v.vm.network :private_network, ip: "ip.address.for.vm3", :netmask => "255.255.0.0"
+ v.vm.provider :virtualbox do |vb|
+ vb.customize ['modifyvm', :id, '--memory', '1024']
+ end
+ end
+end
+EOF
+ end
it "generates a valid windows config" do
FakeFS.activate!
path = vagrant.instance_variable_get( :@vagrant_path )
vagrant.stub( :randmac ).and_return( "0123456789" )
@@ -57,10 +94,10 @@
vagrant.make_vfile( @hosts, {'vagrant_memsize' => 'hello!'} )
generated_file = File.read( File.expand_path( File.join( path, "Vagrantfile") ) )
- match = generated_file.match(/vb.customize \["modifyvm", :id, "--memory", "hello!"\]/)
+ match = generated_file.match(/vb.customize \['modifyvm', :id, '--memory', 'hello!'\]/)
expect( match ).to_not be nil
end