kernel_v2: test for box_url
This commit is contained in:
parent
8ab3ae1bef
commit
d40ff9c390
|
@ -329,9 +329,7 @@ module VagrantPlugins
|
||||||
end
|
end
|
||||||
|
|
||||||
# Make sure the box URL is an array if it is set
|
# Make sure the box URL is an array if it is set
|
||||||
if @box_url && !@box_url.is_a?(Array)
|
@box_url = Array(@box_url) if @box_url
|
||||||
@box_url = [@box_url]
|
|
||||||
end
|
|
||||||
|
|
||||||
# Set the guest properly
|
# Set the guest properly
|
||||||
@guest = @guest.to_sym if @guest
|
@guest = @guest.to_sym if @guest
|
||||||
|
|
|
@ -1329,7 +1329,6 @@ en:
|
||||||
destroying: "Deleting box '%{name}'..."
|
destroying: "Deleting box '%{name}'..."
|
||||||
download:
|
download:
|
||||||
cleaning: "Cleaning up downloaded box..."
|
cleaning: "Cleaning up downloaded box..."
|
||||||
downloading: "Downloading box from URL: %{url}"
|
|
||||||
download_failed: |-
|
download_failed: |-
|
||||||
Download failed. Will try another box URL if there is one.
|
Download failed. Will try another box URL if there is one.
|
||||||
interrupted: "Box download was interrupted. Exiting."
|
interrupted: "Box download was interrupted. Exiting."
|
||||||
|
|
|
@ -33,10 +33,27 @@ describe VagrantPlugins::Kernel_V2::VMConfig do
|
||||||
end
|
end
|
||||||
|
|
||||||
describe "#box_url" do
|
describe "#box_url" do
|
||||||
it "defaults properly" do
|
it "defaults to nil" do
|
||||||
subject.finalize!
|
subject.finalize!
|
||||||
|
|
||||||
expect(subject.box_url).to be_nil
|
expect(subject.box_url).to be_nil
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it "turns into an array" do
|
||||||
|
subject.box_url = "foo"
|
||||||
|
subject.finalize!
|
||||||
|
|
||||||
|
expect(subject.box_url).to eq(
|
||||||
|
["foo"])
|
||||||
|
end
|
||||||
|
|
||||||
|
it "keeps in array" do
|
||||||
|
subject.box_url = ["foo", "bar"]
|
||||||
|
subject.finalize!
|
||||||
|
|
||||||
|
expect(subject.box_url).to eq(
|
||||||
|
["foo", "bar"])
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context "#box_version" do
|
context "#box_version" do
|
||||||
|
|
Loading…
Reference in New Issue