Extending our test

Now that we can write a test, we'll write one simple test that simply mirrors our manifest. This test will help us prevent regression, as changing an existing value or removing an existing resource will cause the test to fail. If this change is intended, the test must also be changed. Although this intuitively feels like it would slow down development, it saves even more time in integration when you can ensure that no new errors have been introduced.

Here is our RSpec test containing the mirror of our original profile:

require 'spec_helper' describe 'profile::jenkins' do on_supported_os.each do |os, os_facts| context "on #{os}" do systemd_fact = case os_facts[:operatingsystemmajrelease] when '6' { systemd: false } else ...

Get Mastering Puppet 5 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.