Created
August 12, 2019 16:50
-
-
Save luksi1/507175be6bc6c790dfb38c02516a51a0 to your computer and use it in GitHub Desktop.
Testing a template with rspec-puppet
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'spec_helper' | |
describe 'foo' do | |
on_supported_os.each do |os, os_facts| | |
context "on #{os}" do | |
let(:facts) { os_facts } | |
describe 'foo equals bar' do | |
let(:pre_condition) do | |
'class {"::foo": | |
foo => "bar", | |
}' | |
end | |
it { is_expected.to compile } | |
it { is_expected.to contain_file('/etc/foo.yml') } | |
it { | |
yml_file_content = "--- | |
foo: bar | |
" | |
is_expected.to contain_file('/etc/foo.yml').with( | |
content: yml_file_content, | |
) | |
} | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment