summaryrefslogtreecommitdiff
path: root/spec/integration/knife
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2015-10-20 16:06:34 -0700
committerLamont Granquist <lamont@scriptkiddie.org>2015-10-26 16:21:06 -0700
commit324fddbb0d2d6ecdd63c0044eaf07e18d1e2de7b (patch)
tree355abebb4787d40a90c6e9ee1f327df6978ba860 /spec/integration/knife
parent4e61b02930ac7b8db3fd040ced2b110bfce54c9f (diff)
downloadchef-324fddbb0d2d6ecdd63c0044eaf07e18d1e2de7b.tar.gz
improve error message, add more tests
Diffstat (limited to 'spec/integration/knife')
-rw-r--r--spec/integration/knife/upload_spec.rb29
1 files changed, 28 insertions, 1 deletions
diff --git a/spec/integration/knife/upload_spec.rb b/spec/integration/knife/upload_spec.rb
index 6ca8c3d8ce..27736349cc 100644
--- a/spec/integration/knife/upload_spec.rb
+++ b/spec/integration/knife/upload_spec.rb
@@ -1,6 +1,6 @@
#
# Author:: John Keiser (<jkeiser@opscode.com>)
-# Copyright:: Copyright (c) 2013 Opscode, Inc.
+# Copyright:: Copyright (c) 2013-2015 Chef Software, Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -699,6 +699,19 @@ EOH
end
end
end
+ when_the_chef_server "is empty" do
+ when_the_repository 'has a cookbook with an invalid chef_version constraint in it' do
+ before do
+ file 'cookbooks/x/metadata.rb', cb_metadata('x', '1.0.0', "\nchef_version '~> 999.0'")
+ end
+ it 'knife upload succeeds' do
+ knife('upload /cookbooks/x').should_succeed <<EOM
+Updated /cookbooks/x
+EOM
+ knife('diff --name-status /cookbooks').should_succeed ''
+ end
+ end
+ end
end # without versioned cookbooks
with_versioned_cookbooks do
@@ -1219,6 +1232,20 @@ EOM
end
end
end
+
+ when_the_chef_server "is empty" do
+ when_the_repository 'has a cookbook with an invalid chef_version constraint in it' do
+ before do
+ file 'cookbooks/x-1.0.0/metadata.rb', cb_metadata('x', '1.0.0', "\nchef_version '~> 999.0'")
+ end
+ it 'knife upload succeeds' do
+ knife('upload /cookbooks/x').should_succeed <<EOM
+Updated /cookbooks/x
+EOM
+ knife('diff --name-status /cookbooks').should_succeed ''
+ end
+ end
+ end
end # with versioned cookbooks
when_the_chef_server 'has a user' do