diff --git a/test/acceptance/provisioning/chef_solo_test.rb b/test/acceptance/provisioning/chef_solo_test.rb index 56b504afc..e59b9413a 100644 --- a/test/acceptance/provisioning/chef_solo_test.rb +++ b/test/acceptance/provisioning/chef_solo_test.rb @@ -18,4 +18,20 @@ describe "vagrant provisioning with chef solo" do results = assert_execute("vagrant", "ssh", "-c", "cat /tmp/chef_solo_basic") results.stdout.should == "success" end + + it "merges JSON into the attributes" do + # Copy the skeleton + environment.skeleton!("chef_solo_json") + + # Setup the basic environment + require_box("default") + assert_execute("vagrant", "box", "add", "base", box_path("default")) + + # Bring up the VM + assert_execute("vagrant", "up") + + # Check for the file it should have created + results = assert_execute("vagrant", "ssh", "-c", "cat /tmp/chef_solo_basic") + results.stdout.should == "json_data" + end end diff --git a/test/acceptance/skeletons/chef_solo_json/README.md b/test/acceptance/skeletons/chef_solo_json/README.md new file mode 100644 index 000000000..4f64aa7ce --- /dev/null +++ b/test/acceptance/skeletons/chef_solo_json/README.md @@ -0,0 +1,3 @@ +# Chef Solo Basic Skeleton + +This is a skeleton that contains a basic chef solo setup. diff --git a/test/acceptance/skeletons/chef_solo_json/cookbooks/basic/recipes/default.rb b/test/acceptance/skeletons/chef_solo_json/cookbooks/basic/recipes/default.rb new file mode 100644 index 000000000..fbf735873 --- /dev/null +++ b/test/acceptance/skeletons/chef_solo_json/cookbooks/basic/recipes/default.rb @@ -0,0 +1,6 @@ +# Create a file where the contents is the data we set with +# the Vagrantfile. +file "/tmp/chef_solo_basic" do + mode 0644 + content node[:test][:data] +end