From 67cd6f73f412ef8fa4c08d5f87a41edd4658993d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micka=C3=ABl=20Can=C3=A9vet?= Date: Fri, 21 Mar 2014 13:58:26 +0100 Subject: [PATCH] Fix unit tests with rspec-puppet 1.0 --- Gemfile | 2 +- spec/unit/defines/server/pg_hba_rule_spec.rb | 20 ++++++++++++-------- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/Gemfile b/Gemfile index 1cf440d..731fa83 100644 --- a/Gemfile +++ b/Gemfile @@ -3,7 +3,7 @@ source ENV['GEM_SOURCE'] || "https://rubygems.org" group :development, :test do gem 'rake' gem 'puppetlabs_spec_helper', :require => false - gem 'rspec-puppet', '< 1.0' + gem 'rspec-puppet', '~> 1.0' gem 'puppet-lint', '~> 0.3.2' gem 'beaker', :require => false gem 'beaker-rspec', :require => false diff --git a/spec/unit/defines/server/pg_hba_rule_spec.rb b/spec/unit/defines/server/pg_hba_rule_spec.rb index b01e338..a4f6410 100644 --- a/spec/unit/defines/server/pg_hba_rule_spec.rb +++ b/spec/unit/defines/server/pg_hba_rule_spec.rb @@ -28,8 +28,9 @@ describe 'postgresql::server::pg_hba_rule', :type => :define do } end it do - content = param('concat::fragment', 'pg_hba_rule_test', 'content') - content.should =~ /host\s+all\s+all\s+1\.1\.1\.1\/24\s+md5/ + should contain_concat__fragment('pg_hba_rule_test').with({ + :content => /host\s+all\s+all\s+1\.1\.1\.1\/24\s+md5/ + }) end end @@ -44,8 +45,9 @@ describe 'postgresql::server::pg_hba_rule', :type => :define do } end it do - content = param('concat::fragment', 'pg_hba_rule_test', 'content') - content.should =~ /local\s+all\s+all\s+ident/ + should contain_concat__fragment('pg_hba_rule_test').with({ + :content => /local\s+all\s+all\s+ident/ + }) end end @@ -62,8 +64,9 @@ describe 'postgresql::server::pg_hba_rule', :type => :define do } end it do - content = param('concat::fragment', 'pg_hba_rule_test', 'content') - content.should =~ /host\s+all\s+all\s+0\.0\.0\.0\/0\s+ldap\s+foo=bar/ + should contain_concat__fragment('pg_hba_rule_test').with({ + :content => /host\s+all\s+all\s+0\.0\.0\.0\/0\s+ldap\s+foo=bar/ + }) end end @@ -152,8 +155,9 @@ describe 'postgresql::server::pg_hba_rule', :type => :define do end it do - content = param('concat::fragment', 'pg_hba_rule_test', 'content') - content.should =~ /local\s+all\s+all\s+0\.0\.0\.0\/0\s+peer/ + should contain_concat__fragment('pg_hba_rule_test').with({ + :content => /local\s+all\s+all\s+0\.0\.0\.0\/0\s+peer/ + }) end end