From 582b6a178862e730670b279100aaf889967a139e Mon Sep 17 00:00:00 2001 From: Romain THERRAT Date: Mon, 23 Dec 2013 18:41:15 +0100 Subject: [PATCH] Fix test with 1.0 rspec-puppet version --- spec/classes/fail2ban_spec.rb | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) 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