Sha256: 371b1ee6d67fc5c99a42eaa0bab4c0b67f898a659d7b88d406a0474e37c24ad1

Contents?: true

Size: 1.28 KB

Versions: 59

Compression:

Stored size: 1.28 KB

Contents

require File.expand_path("../base", __FILE__)
require "acceptance/support/shared/command_examples"

describe "vagrant up", "with a box URL set" do
  include_context "acceptance"

  it "downloads and brings up the VM if the box doesn't exist" do
    require_box("default")

    assert_execute("vagrant", "init", "base", box_path("default"))
    result = assert_execute("vagrant", "up")
    result.stdout.should match_output(:up_fetching_box, "base")
  end

  it "downloads the file only once and works if shared by multiple VMs", :issue => "GH-564" do
    require_box("default")

    environment.workdir.join("Vagrantfile").open("w+") do |f|
      f.puts(<<-VFILE)
Vagrant::Config.run do |config|
  config.vm.define :machine1 do |vm_config|
    vm_config.vm.box = "base"
    vm_config.vm.box_url = "#{box_path("default")}"
  end

  config.vm.define :machine2 do |vm_config|
    vm_config.vm.box = "base"
    vm_config.vm.box_url = "#{box_path("default")}"
  end
end
VFILE
    end

    # Bring up the environment, which should work. `machine1` should download
    # the box while `machine2` doesn't.
    result = assert_execute("vagrant", "up")
    result.stdout.should match_output(:up_fetching_box, "base", "machine1")
    result.stdout.should_not match_output(:up_fetching_box, "base", "machine2")
  end
end

Version data entries

59 entries across 59 versions & 11 rubygems

Version Path
tamtam-vagrant-reload-1.1.3 vendor/cache/vagrant-0ac2a8738841/test/acceptance/up_with_box_url.rb
tamtam-vagrant-reload-1.1.2 vendor/cache/vagrant-0ac2a8738841/test/acceptance/up_with_box_url.rb
tamtam-vagrant-reload-1.1.1 vendor/cache/vagrant-0ac2a8738841/test/acceptance/up_with_box_url.rb
tamtam-vagrant-reload-1.1 vendor/cache/vagrant-0ac2a8738841/test/acceptance/up_with_box_url.rb
bmhatfield-vagrant-1.0.10 test/acceptance/up_with_box_url.rb
bmhatfield-vagrant-1.0.9 test/acceptance/up_with_box_url.rb
tnargav-1.3.6 test/acceptance/up_with_box_url.rb
tnargav-1.3.3 test/acceptance/up_with_box_url.rb
bmhatfield-vagrant-1.0.8 test/acceptance/up_with_box_url.rb
vagrant-shell-0.2.9 demo/templates/vendor/bundle/ruby/1.9.1/gems/tnargav-1.2.2/test/acceptance/up_with_box_url.rb
tnargav-1.2.3 test/acceptance/up_with_box_url.rb
vagrant-shell-0.2.8 demo/templates/vendor/bundle/ruby/1.9.1/gems/tnargav-1.2.2/test/acceptance/up_with_box_url.rb
bmhatfield-vagrant-1.0.7 test/acceptance/up_with_box_url.rb
vagrant-shell-0.2.6 vendor/bundle/gems/tnargav-1.2.2/test/acceptance/up_with_box_url.rb
vagrant-shell-0.2.5 vendor/bundle/gems/tnargav-1.2.2/test/acceptance/up_with_box_url.rb
tnargav-1.2.2 test/acceptance/up_with_box_url.rb
vagrantup-1.1.3 test/acceptance/up_with_box_url.rb
vagrantup-1.1.2 test/acceptance/up_with_box_url.rb
vagrantup-1.1.1 test/acceptance/up_with_box_url.rb
vagrantup-1.1.0 test/acceptance/up_with_box_url.rb