[[Puppet]] [Rspec Puppet](https://rspec-puppet.com/) --- ```ruby require 'spec_helper' describe '' do # Your tests go in here end ``` --- `is_expected.to` or `is_expected.to_not` defined types need a title: `let(:title) { 'title' }` parameters: `let(:params) { { 'a' => 'b' } }` `contain_class('name')` or `contain_name` `contain_` < can be suffixed with anything, ie `contain_file`, `contain_exec`, `contain_class` or just `contain_apache__params` for defined types. `::` in `apache::params` -> `apache__params` of a defined type. To test parameters chain `.with()` which contains a hash of expected paremeters. With can also be suffixed with the name of the param, ie `.with_ensure()`. `only_with` for ensuring that a argument is the only argument being set on given resource. --- > If a class is an fully qualified class reference (start with`::`) then in the test **do not** include the double colon to reference the class only use its name. ```puppet // manifest class { '::tempest': } // test is_expected.to contain_class('tempest') <- valid is_expected.to contain_class('::tempest') <- invalid ```