Foodtaster Example Project
This repository shows how to use Foodtaster to write specs for Chef cookbooks.
Layout of this repository resembles layout of any other Chef
Repo, except for
directories not required in this example, like
roles. You can create them if you need.
cookbooks contains community cookbooks which are installed
site-cookbooks is for
cookbooks you develop.
spec is a directory where all automated test
scripts (specs) are stored.
vagrant plugin install vagrant-foodtaster-server
Clone this repository using git:
git clone https://github.com/mlapshin/foodtaster-example.git
Next, invoke Bundler to install all required gems:
cd foodtaster-example bundle install
Finally, invoke Berkshelf to install community cookbooks in
berks install --path cookbooks
Now you should be able to run specs with:
This repository contains two cookbooks,
nfs_example. There are specs for both of them located in
This cookbook installs
nginx package on Ubuntu system without any
It's spec file
spec/nginx_cookbook_spec.rb uses different Foodtaster
matchers to check if nginx server was installed and working properly.
Read comments in spec file for more details.
More complicated example which installs NFS server and creates NFS mounts on client.
spec/nfs_cookbook_spec.rb shows how to use several VMs to
make cross-machine (integration) tests. In this spec one VM is an NFS
server and second is a client. Spec make some operations in NFS volume
on one VM and check if they are propagated to other. Read comments in
spec file for more details.