ChefSpec is a unit testing framework for testing Chef cookbooks. ChefSpec makes it easy to write examples and get fast feedback on cookbook changes without the need for virtual machines or cloud servers.
ChefSpec runs your cookbook locally using Chef Solo without actually converging a node. This has two primary benefits:
- It's really fast!
- Your tests can vary node attributes, operating systems, and search results to assert behavior under varying conditions.
You can install ChefSpec from Rubygems:
gem install chefspec
Or add it to your Gemfile
gem 'chefspec'
Additional Resources/Links
- Rubygems: http://rubygems.org/gems/chefspec
- GitHub: https://github.com/sethvargo/chefspec