Sha256: 5ce2fd44f98970caa567a8f08537f1a612a7b811a3b57d5dc34f543df4699c70

Contents?: true

Size: 1.05 KB

Versions: 5

Compression:

Stored size: 1.05 KB

Contents

require File.expand_path("../base", __FILE__)

describe "vagrant init" do
  include_context "acceptance"

  it "creates a Vagrantfile in the working directory" do
    vagrantfile = environment.workdir.join("Vagrantfile")
    vagrantfile.exist?.should_not be, "Vagrantfile shouldn't exist initially"

    result = execute("vagrant", "init")
    result.should be_success
    vagrantfile.exist?.should be, "Vagrantfile should exist"
  end

  it "creates a Vagrantfile with the box set to the given argument" do
    vagrantfile = environment.workdir.join("Vagrantfile")

    result = execute("vagrant", "init", "foo")
    result.should be_success
    vagrantfile.read.should match(/config.vm.box = "foo"$/)
  end

  it "creates a Vagrantfile with the box URL set to the given argument" do
    vagrantfile = environment.workdir.join("Vagrantfile")

    result = execute("vagrant", "init", "foo", "bar")
    result.should be_success

    contents = vagrantfile.read
    contents.should match(/config.vm.box = "foo"$/)
    contents.should match(/config.vm.box_url = "bar"$/)
  end
end

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
vagrantup-0.8.9 test/acceptance/init_test.rb
vagrantup-0.8.8 test/acceptance/init_test.rb
vagrantup-0.8.10 test/acceptance/init_test.rb
vagrant-0.8.10 test/acceptance/init_test.rb
vagrant-0.8.8 test/acceptance/init_test.rb