From 31ece8324b66f955bb29bb5a81ac087706152aef Mon Sep 17 00:00:00 2001 From: Mark Mickan Date: Wed, 20 Jan 2016 10:43:19 +1030 Subject: [PATCH] Add tests for using prerelease box versions --- test/unit/vagrant/box_collection_test.rb | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/test/unit/vagrant/box_collection_test.rb b/test/unit/vagrant/box_collection_test.rb index f0e5e0edc..21a39ae70 100644 --- a/test/unit/vagrant/box_collection_test.rb +++ b/test/unit/vagrant/box_collection_test.rb @@ -194,6 +194,19 @@ describe Vagrant::BoxCollection, :skip_windows do expect(result.version).to eq("1.0") end + it "handles prerelease versions" do + # Create the "box" + environment.box3("foo", "0.1.0-alpha.1", :virtualbox) + environment.box3("foo", "0.1.0-alpha.2", :virtualbox) + + # Actual test + result = subject.find("foo", :virtualbox, ">= 0") + expect(result).to_not be_nil + expect(result).to be_kind_of(box_class) + expect(result.name).to eq("foo") + expect(result.version).to eq("0.1.0-alpha.2") + end + it "returns nil if a box's constraints can't be satisfied" do # Create the "box" environment.box3("foo", "0.1", :virtualbox)