summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2015-10-23 10:44:26 -0700
committerLamont Granquist <lamont@scriptkiddie.org>2015-10-26 16:21:07 -0700
commita75ce7ce4c5ee9565f536430244a37bc33cd4e59 (patch)
tree1549a781d8b4f58c2cca9c63078fb6b2601e1a20
parentd0bda9d32fcb863d65105d2119ab3f04a10f45e8 (diff)
downloadchef-lcg/chef-version.tar.gz
add integration test for the client sidelcg/chef-version
-rw-r--r--spec/integration/client/client_spec.rb20
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