summaryrefslogtreecommitdiff
path: root/spec/integration/client
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2015-01-25 18:40:24 -0800
committerLamont Granquist <lamont@scriptkiddie.org>2015-01-25 18:40:24 -0800
commita151dea58310b51fdcb7afa78171e7ab70044170 (patch)
treede9df5a7a957119a7dae24e3335040108fa4cc12 /spec/integration/client
parent8a805c8a71a91cb17099acdc748f619eeba45efd (diff)
downloadchef-a151dea58310b51fdcb7afa78171e7ab70044170.tar.gz
fix master
broken by merging #2431. code was actually broken and the specs were broken, not sure how it got into ready-to-merge in that state. rolled back the FileUtils.rm_rf that was in the original patch since it trashed my chef git repo and in light of: https://github.com/ValveSoftware/steam-for-linux/issues/3671 i think the rm_rf is a bad idea.
Diffstat (limited to 'spec/integration/client')
-rw-r--r--spec/integration/client/client_spec.rb11
1 files changed, 7 insertions, 4 deletions
diff --git a/spec/integration/client/client_spec.rb b/spec/integration/client/client_spec.rb
index 880e9c55d8..3475a569b6 100644
--- a/spec/integration/client/client_spec.rb
+++ b/spec/integration/client/client_spec.rb
@@ -1,5 +1,7 @@
require 'support/shared/integration/integration_helper'
require 'chef/mixin/shell_out'
+require 'tiny_server'
+require 'tmpdir'
def recipes_filename
File.join(CHEF_SPEC_DATA, 'recipes.tgz')
@@ -315,17 +317,18 @@ end
stop_tiny_server
end
+ let(:tmp_dir) { Dir.mktmpdir("recipe-url") }
+
it "should complete with success when passed -z and --recipe-url" do
file 'config/client.rb', <<EOM
-cookbook_path "#{path_to('cookbooks')}"
+chef_repo_path "#{tmp_dir}"
EOM
-
- result = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" --recipe-url=http://localhost:9000/recipes.tgz -o 'x::default' -z", :cwd => chef_dir)
+ result = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" --recipe-url=http://localhost:9000/recipes.tgz -o 'x::default' -z", :cwd => tmp_dir)
result.error!
end
it 'should fail when passed --recipe-url and not passed -z' do
- result = shell_out("#{chef_client} --recipe-url=http://localhost:9000/recipes.tgz", :cwd => chef_dir)
+ result = shell_out("#{chef_client} --recipe-url=http://localhost:9000/recipes.tgz", :cwd => tmp_dir)
expect(result.exitstatus).to eq(1)
end
end