summaryrefslogtreecommitdiff
path: root/spec/integration/knife
diff options
context:
space:
mode:
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