diff options
author | John Keiser <jkeiser@opscode.com> | 2013-09-12 22:58:53 -0700 |
---|---|---|
committer | John Keiser <jkeiser@opscode.com> | 2013-10-02 11:57:50 -0700 |
commit | 75ac2c3345e1dcf238c8c9fa7c188294439262a1 (patch) | |
tree | 08834c42357caaf2beed467e00ae6f8966049ce9 /spec/integration/solo | |
parent | ded680b1decec30b470f26c8faa1d637f26add77 (diff) | |
download | chef-75ac2c3345e1dcf238c8c9fa7c188294439262a1.tar.gz |
Minify chef-solo spec
Diffstat (limited to 'spec/integration/solo')
-rw-r--r-- | spec/integration/solo/solo_spec.rb | 41 |
1 files changed, 12 insertions, 29 deletions
diff --git a/spec/integration/solo/solo_spec.rb b/spec/integration/solo/solo_spec.rb index 667a9ad87b..4ffb618311 100644 --- a/spec/integration/solo/solo_spec.rb +++ b/spec/integration/solo/solo_spec.rb @@ -5,37 +5,20 @@ describe "chef-solo" do extend IntegrationSupport include Chef::Mixin::ShellOut - context "with a no-op recipe in the run_list" do - - when_the_repository "has a cookbook with a no-op recipe" do - directory 'cookbooks' - directory 'cookbooks/x' - directory 'cookbooks/x/recipes' - file 'cookbooks/x/metadata.rb', 'version "1.0.0"' - file 'cookbooks/x/recipes/default.rb', '' - - before do - @chef_file_cache = Dir.mktmpdir('file_cache') - end - - after do - FileUtils.rm_rf(@chef_file_cache) if @chef_file_cache - end - - it "should complete with success" do - # prepare the solo config - directory 'config' - file 'config/solo.rb', <<EOM -cookbook_path "#{File.join(@repository_dir, 'cookbooks')}" -file_cache_path "#{@chef_file_cache}" + when_the_repository "has a cookbook with a no-op recipe" do + file 'cookbooks/x/metadata.rb', 'version "1.0.0"' + file 'cookbooks/x/recipes/default.rb', '' + + it "should complete with success" do + file 'config/solo.rb', <<EOM +cookbook_path "#{path_to('cookbooks')}" +file_cache_path "#{path_to('config/cache')}" EOM - config_file = canonicalize_path(File.join(@repository_dir, 'config', 'solo.rb')) - - chef_dir = File.join(File.dirname(__FILE__), "..", "..", "..", "bin") - result = shell_out("chef-solo -c \"#{config_file}\" -o 'x::default' -l debug", :cwd => chef_dir) - result.error! - end + chef_dir = File.join(File.dirname(__FILE__), "..", "..", "..", "bin") + result = shell_out("chef-solo -c \"#{path_to('config/solo.rb')}\" -o 'x::default' -l debug", :cwd => chef_dir) + result.error! end + end end |