Gave better examples of how to test templates

I wanted to work off what abe did to give examples to others on
ways to add attributes and test conditionals.
This commit is contained in:
John Dewey
2013-05-09 16:06:19 -07:00
parent 6ffe37b361
commit 1925451f67
6 changed files with 95 additions and 23 deletions

View File

@@ -45,17 +45,6 @@ def expect_creates_cinder_conf service, action=:restart
expect(sprintf("%o", @file.mode)).to eq "644"
end
it "template contents" do
expect(@chef_run).to create_file_with_content "/etc/cinder/cinder.conf", "autogenerated"
expect(@chef_run).to create_file_with_content "/etc/cinder/cinder.conf", "logging.conf"
expect(@chef_run).to create_file_with_content "/etc/cinder/cinder.conf", "lock_path=/var/lock/cinder"
expect(@chef_run).to create_file_with_content "/etc/cinder/cinder.conf", "rbd_pool=rbd"
expect(@chef_run).to create_file_with_content "/etc/cinder/cinder.conf", "iscsi_helper=tgtadm"
expect(@chef_run).to create_file_with_content "/etc/cinder/cinder.conf", "RBDDriver"
expect(@chef_run).not_to create_file_with_content "/etc/cinder/cinder.conf", "NetAppISCSIDriver"
end
it "notifies nova-api-ec2 restart" do
expect(@file).to notify service, action
end