Test for DNA json in Chef Solo

This commit is contained in:
Mitchell Hashimoto 2012-01-10 21:14:16 -08:00
parent 18cdcb4330
commit 29ced979a2
3 changed files with 25 additions and 0 deletions

View File

@ -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

View File

@ -0,0 +1,3 @@
# Chef Solo Basic Skeleton
This is a skeleton that contains a basic chef solo setup.

View File

@ -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