diff options
-rw-r--r-- | spec/integration/client/client_spec.rb | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/spec/integration/client/client_spec.rb b/spec/integration/client/client_spec.rb index 314a9310be..41645adb9e 100644 --- a/spec/integration/client/client_spec.rb +++ b/spec/integration/client/client_spec.rb @@ -320,6 +320,26 @@ EOM end end + when_the_repository "has a cookbook that should fail chef_version checks" do + before do + file 'cookbooks/x/recipes/default.rb', '' + file 'cookbooks/x/metadata.rb', <<EOM +name 'x' +version '0.0.1' +chef_version '~> 999.99' +EOM + file 'config/client.rb', <<EOM +local_mode true +cookbook_path "#{path_to('cookbooks')}" +EOM + end + it "should fail the chef client run" do + command = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" -o 'x::default' --no-fork", :cwd => chef_dir) + expect(command.exitstatus).to eql(1) + expect(command.stdout).to match(/Chef::Exceptions::CookbookChefVersionMismatch/) + end + end + when_the_repository "has a cookbook that generates deprecation warnings" do before do file 'cookbooks/x/recipes/default.rb', <<-EOM |