diff options
author | Xabier de Zuazo <xabier@onddo.com> | 2013-02-10 18:42:16 +0100 |
---|---|---|
committer | Bryan McLellan <btm@opscode.com> | 2013-06-19 14:09:57 -0700 |
commit | 1504a1d133f5a8c71431027bc9012fdb8507fde5 (patch) | |
tree | bfc54bc22a043dc471bbe137f20a8cb705a56dfd /spec/unit/version_class_spec.rb | |
parent | 182532e7ef9f5eab1e721f6c3fe7f62af7e95091 (diff) | |
download | chef-1504a1d133f5a8c71431027bc9012fdb8507fde5.tar.gz |
[CHEF-3029] Chef::Version tests fixed to test versions such as "1" correctly
Diffstat (limited to 'spec/unit/version_class_spec.rb')
-rw-r--r-- | spec/unit/version_class_spec.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/spec/unit/version_class_spec.rb b/spec/unit/version_class_spec.rb index 285588b031..330d399086 100644 --- a/spec/unit/version_class_spec.rb +++ b/spec/unit/version_class_spec.rb @@ -34,6 +34,10 @@ describe Chef::Version do a.should == @v123 end + it "should transform 1 to 1.0.0" do + Chef::Version.new("1").to_s.should == "1.0.0" + end + it "should transform 1.2 to 1.2.0" do Chef::Version.new("1.2").to_s.should == "1.2.0" end @@ -53,7 +57,7 @@ describe Chef::Version do end describe "when given bogus input" do - bad_versions = ["1.2.3.4", "1.2.a4", "1", "a", "1.2 3", "1.2 a", + bad_versions = ["1.2.3.4", "1.2.a4", "a", "1.2 3", "1.2 a", "1 2 3", "1-2-3", "1_2_3", "1.2_3", "1.2-3"] the_error = Chef::Exceptions::InvalidCookbookVersion bad_versions.each do |v| |