diff --git a/spec/classes/hitch_spec.rb b/spec/classes/hitch_spec.rb index 7aa5fa8..8cc095b 100644 --- a/spec/classes/hitch_spec.rb +++ b/spec/classes/hitch_spec.rb @@ -1,11 +1,28 @@ require 'spec_helper' describe 'hitch' do on_supported_os.each do |os, os_facts| context "on #{os}" do let(:facts) { os_facts } - it { is_expected.to compile } + context 'defaults' do + it { is_expected.to compile } + it { is_expected.to contain_exec('hitch::config generate dhparams') } + it { + is_expected.to contain_file('/etc/hitch/dhparams.pem') + .without_content + } + end + + context 'with dhparams_content' do + let(:params) { { dhparams_content: 'BEGIN DH PARAMETERS' } } + + it { is_expected.not_to contain_exec('hitch::config generate dhparams') } + it { + is_expected.to contain_file('/etc/hitch/dhparams.pem') + .with_content(%r{BEGIN DH PARAMETERS}) + } + end end end end