Add coverage on box version in minimal init

This commit is contained in:
Chris Roberts 2017-02-22 12:31:24 -08:00
parent 5a69d83a55
commit 9394679cb7
1 changed files with 7 additions and 0 deletions

View File

@ -78,6 +78,13 @@ describe VagrantPlugins::CommandInit::Command do
expect(contents).to match(/config.vm.box_version = "1.2.3"/)
end
it "creates a minimal Vagrantfile with a box and box version" do
described_class.new(["--minimal", "--box-version", "1.2.3", "hashicorp/precise64"], env).execute
contents = File.read(vagrantfile_path)
expect(contents).to match(/config.vm.box = "hashicorp\/precise64"/)
expect(contents).to match(/config.vm.box_version = "1.2.3"/)
end
it "creates a Vagrantfile at a custom path" do
described_class.new(["--output", "vf.rb"], env).execute
expect(File.exist?(File.join(env.cwd, "vf.rb"))).to be(true)