Information Technology Reference
In-Depth Information
Chef includes testing tools that support this approach. As Figure 16-4 shows, Chef provides
multiple testing tools specialized to give you feedback on issues with your code at the earli-
est possible time during the cookbook authoring process.
Figure 16-4. Chef's testing tools for every phase of development
There are multiple tools because each is tailored to run in a particular cookbook authoring
phase. Following is a brief overview of each tool and when you use it:
▪ In your text editor when you type:
Foodcritic analyzes your Chef coding style.
▪ Before you deploy to a test node:
ChefSpec helps you document and organize your code.
▪ After you deploy to a test node:
Serverspec verifies that a cookbook behaves as intended.
NOTE
In this chapter, we use the terms test and example interchangeably.
For those using Chef Client, you will need to install some additional gems to support testing.
Run the following to install the required tools for this chapter:
$ sudo gem install foodcritic --no-ri --no-rdoc
$ sudo gem install chefspec --no-ri --no-rdoc
Search WWH ::




Custom Search