diff --git a/spec/classes/fail2ban_spec.rb b/spec/classes/fail2ban_spec.rb index fcbb604..a981938 100644 --- a/spec/classes/fail2ban_spec.rb +++ b/spec/classes/fail2ban_spec.rb @@ -97,12 +97,10 @@ enabled = true/) } describe 'Test customizations - template' do let(:params) { {:template => "fail2ban/spec.erb" , :options => { 'opt_a' => 'value_a' } } } it 'should generate a valid template' do - content = catalogue.resource('file', 'fail2ban.local').send(:parameters)[:content] - content.should match "fqdn: rspec.example42.com" + should contain_file('fail2ban.local').with_content(/fqdn: rspec.example42.com/) end it 'should generate a template that uses custom options' do - content = catalogue.resource('file', 'fail2ban.local').send(:parameters)[:content] - content.should match "value_a" + should contain_file('fail2ban.local').with_content(/value_a/) end end @@ -136,8 +134,7 @@ enabled = true/) } } end it 'should not automatically restart the service, when service_autorestart => false' do - content = catalogue.resource('file', 'fail2ban.local').send(:parameters)[:notify] - content.should be_nil + should contain_file('fail2ban.local').with_notify(nil) end end