diff options
author | danielsdeleo <dan@opscode.com> | 2013-10-24 13:12:46 -0700 |
---|---|---|
committer | danielsdeleo <dan@opscode.com> | 2013-10-24 13:49:39 -0700 |
commit | cd7ccaea726f3f9d98f9df3f5d56bb22b290f490 (patch) | |
tree | 0c424d3d846ba54f59b32cb1bebbfabe25d19c80 /spec/integration/solo | |
parent | d5b46e912598981da53d3e9008787bc6af8c645d (diff) | |
download | chef-cd7ccaea726f3f9d98f9df3f5d56bb22b290f490.tar.gz |
Application::Solo must set @chef_client_json
A past refactor was incomplete, leaving references to chef_solo_json.
The contract with the superclass is that json data is set to
@chef_client_json
Conflicts:
spec/integration/solo/solo_spec.rb
Diffstat (limited to 'spec/integration/solo')
-rw-r--r-- | spec/integration/solo/solo_spec.rb | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/spec/integration/solo/solo_spec.rb b/spec/integration/solo/solo_spec.rb index 90b8273f46..94d279c726 100644 --- a/spec/integration/solo/solo_spec.rb +++ b/spec/integration/solo/solo_spec.rb @@ -9,19 +9,37 @@ describe "chef-solo" do extend IntegrationSupport include Chef::Mixin::ShellOut - when_the_repository "has a cookbook with a no-op recipe" do + let(:chef_dir) { File.join(File.dirname(__FILE__), "..", "..", "..") } + + when_the_repository "has a cookbook with a basic recipe" do file 'cookbooks/x/metadata.rb', 'version "1.0.0"' - file 'cookbooks/x/recipes/default.rb', '' + file 'cookbooks/x/recipes/default.rb', 'puts "ITWORKS"' it "should complete with success" do file 'config/solo.rb', <<EOM cookbook_path "#{path_to('cookbooks')}" file_cache_path "#{path_to('config/cache')}" EOM - chef_dir = File.join(File.dirname(__FILE__), "..", "..", "..") result = shell_out("ruby bin/chef-solo -c \"#{path_to('config/solo.rb')}\" -o 'x::default' -l debug", :cwd => chef_dir) result.error! + result.stdout.should include("ITWORKS") end + + it "should evaluate its node.json file" do + file 'config/solo.rb', <<EOM +cookbook_path "#{path_to('cookbooks')}" +file_cache_path "#{path_to('config/cache')}" +EOM + + file 'config/node.json',<<-E +{"run_list":["x::default"]} +E + + result = shell_out("ruby bin/chef-solo -c \"#{path_to('config/solo.rb')}\" -j '#{path_to('config/node.json')}' -l debug", :cwd => chef_dir) + result.error! + result.stdout.should include("ITWORKS") + end + end when_the_repository "has a cookbook with a recipe with sleep" do |