diff --git a/spec/classes/postfix_augeas_spec.rb b/spec/classes/postfix_augeas_spec.rb index 9fdcbb274d487cff516aa03edbf74e426c05a9ae..ff068e9b287f58cadf6674cdea585adeed505e28 100644 --- a/spec/classes/postfix_augeas_spec.rb +++ b/spec/classes/postfix_augeas_spec.rb @@ -13,13 +13,13 @@ describe 'postfix::augeas' do "include ::augeas" end - it { should contain_augeas__lens('postfix_transport').with( + it { is_expected.to contain_augeas__lens('postfix_transport').with( :ensure => 'present', :lens_source => 'puppet:///modules/postfix/lenses/postfix_transport.aug', :test_source => 'puppet:///modules/postfix/lenses/test_postfix_transport.aug', :stock_since => '1.0.0' ) } - it { should contain_augeas__lens('postfix_virtual').with( + it { is_expected.to contain_augeas__lens('postfix_virtual').with( :ensure => 'present', :lens_source => 'puppet:///modules/postfix/lenses/postfix_virtual.aug', :test_source => 'puppet:///modules/postfix/lenses/test_postfix_virtual.aug', diff --git a/spec/classes/postfix_mta_spec.rb b/spec/classes/postfix_mta_spec.rb index 5dea40015d4258dde5382ab46a08700a0dfb5702..395beaedf97c793790b38f19fada21e18e3d78c1 100644 --- a/spec/classes/postfix_mta_spec.rb +++ b/spec/classes/postfix_mta_spec.rb @@ -13,7 +13,7 @@ describe 'postfix::mta' do }" end - it { should contain_postfix__config('mydestination').with_value('bar') } - it { should contain_postfix__config('mynetworks').with_value('baz') } - it { should contain_postfix__config('relayhost').with_value('foo') } + it { is_expected.to contain_postfix__config('mydestination').with_value('bar') } + it { is_expected.to contain_postfix__config('mynetworks').with_value('baz') } + it { is_expected.to contain_postfix__config('relayhost').with_value('foo') } end diff --git a/spec/classes/postfix_satellite_spec.rb b/spec/classes/postfix_satellite_spec.rb index feb177b2872f2df91785beb4c035136f1d3de3c7..a3cf4d53ff8d5a6de61a81500ba4bb68817a1595 100644 --- a/spec/classes/postfix_satellite_spec.rb +++ b/spec/classes/postfix_satellite_spec.rb @@ -17,8 +17,8 @@ describe 'postfix::satellite' do mynetworks => 'baz', }" end - it { should contain_class('postfix::mta') } - it { should contain_postfix__virtual('@foo.example.com').with( + it { is_expected.to contain_class('postfix::mta') } + it { is_expected.to contain_postfix__virtual('@foo.example.com').with( :ensure => 'present', :destination => 'root' ) } diff --git a/spec/classes/postfix_spec.rb b/spec/classes/postfix_spec.rb index ecb7aa8fe6dfbcb732d8747b052cce1b4dc3bd13..e34b0238e6a59776afdfbe9c13b0d69dbbd974a8 100644 --- a/spec/classes/postfix_spec.rb +++ b/spec/classes/postfix_spec.rb @@ -11,23 +11,23 @@ describe 'postfix' do :path => '/foo/bar', } } - it { should contain_package('postfix') } - it { should contain_package('mailx') } + it { is_expected.to contain_package('postfix') } + it { is_expected.to contain_package('mailx') } - it { should contain_file('/etc/mailname').without('seltype').with_content("fqdn.example.com\n") } - it { should contain_file('/etc/aliases').without('seltype').with_content("# file managed by puppet\n") } - it { should contain_exec('newaliases').with_refreshonly('true') } - it { should contain_file('/etc/postfix/master.cf').without('seltype') } - it { should contain_file('/etc/postfix/main.cf').without('seltype') } + it { is_expected.to contain_file('/etc/mailname').without('seltype').with_content("fqdn.example.com\n") } + it { is_expected.to contain_file('/etc/aliases').without('seltype').with_content("# file managed by puppet\n") } + it { is_expected.to contain_exec('newaliases').with_refreshonly('true') } + it { is_expected.to contain_file('/etc/postfix/master.cf').without('seltype') } + it { is_expected.to contain_file('/etc/postfix/main.cf').without('seltype') } - it { should contain_postfix__config('myorigin').with_value('fqdn.example.com') } - it { should contain_postfix__config('alias_maps').with_value('hash:/etc/aliases') } - it { should contain_postfix__config('inet_interfaces').with_value('all') } + it { is_expected.to contain_postfix__config('myorigin').with_value('fqdn.example.com') } + it { is_expected.to contain_postfix__config('alias_maps').with_value('hash:/etc/aliases') } + it { is_expected.to contain_postfix__config('inet_interfaces').with_value('all') } - it { should contain_mailalias('root').with_recipient('nobody') } + it { is_expected.to contain_mailalias('root').with_recipient('nobody') } it { - should contain_service('postfix').with( + is_expected.to contain_service('postfix').with( :ensure => 'running', :enable => 'true', :hasstatus => 'true', @@ -44,26 +44,26 @@ describe 'postfix' do :path => '/foo/bar', } } - it { should contain_package('postfix') } - it { should contain_package('mailx') } + it { is_expected.to contain_package('postfix') } + it { is_expected.to contain_package('mailx') } - it { should contain_file('/etc/mailname').with_seltype('postfix_etc_t').with_content("fqdn.example.com\n") } - it { should contain_file('/etc/aliases').with_seltype('postfix_etc_t').with_content("# file managed by puppet\n") } - it { should contain_exec('newaliases').with_refreshonly('true') } - it { should contain_file('/etc/postfix/master.cf').with_seltype('postfix_etc_t') } - it { should contain_file('/etc/postfix/main.cf').with_seltype('postfix_etc_t') } + it { is_expected.to contain_file('/etc/mailname').with_seltype('postfix_etc_t').with_content("fqdn.example.com\n") } + it { is_expected.to contain_file('/etc/aliases').with_seltype('postfix_etc_t').with_content("# file managed by puppet\n") } + it { is_expected.to contain_exec('newaliases').with_refreshonly('true') } + it { is_expected.to contain_file('/etc/postfix/master.cf').with_seltype('postfix_etc_t') } + it { is_expected.to contain_file('/etc/postfix/main.cf').with_seltype('postfix_etc_t') } - it { should contain_postfix__config('myorigin').with_value('fqdn.example.com') } - it { should contain_postfix__config('alias_maps').with_value('hash:/etc/aliases') } - it { should contain_postfix__config('inet_interfaces').with_value('all') } - it { should contain_postfix__config('sendmail_path') } - it { should contain_postfix__config('newaliases_path') } - it { should contain_postfix__config('mailq_path') } + it { is_expected.to contain_postfix__config('myorigin').with_value('fqdn.example.com') } + it { is_expected.to contain_postfix__config('alias_maps').with_value('hash:/etc/aliases') } + it { is_expected.to contain_postfix__config('inet_interfaces').with_value('all') } + it { is_expected.to contain_postfix__config('sendmail_path') } + it { is_expected.to contain_postfix__config('newaliases_path') } + it { is_expected.to contain_postfix__config('mailq_path') } - it { should contain_mailalias('root').with_recipient('nobody') } + it { is_expected.to contain_mailalias('root').with_recipient('nobody') } it { - should contain_service('postfix').with( + is_expected.to contain_service('postfix').with( :ensure => 'running', :enable => 'true', :hasstatus => 'true', @@ -99,14 +99,14 @@ describe 'postfix' do :master_submission => 'submission inet n - - - - smtpd', } } - it { should contain_package('postfix') } - it { should contain_package('mailx') } + it { is_expected.to contain_package('postfix') } + it { is_expected.to contain_package('mailx') } - it { should contain_file('/etc/mailname').without('seltype').with_content("fqdn.example.com\n") } - it { should contain_file('/etc/aliases').without('seltype').with_content("# file managed by puppet\n") } - it { should contain_exec('newaliases').with_refreshonly('true') } + it { is_expected.to contain_file('/etc/mailname').without('seltype').with_content("fqdn.example.com\n") } + it { is_expected.to contain_file('/etc/aliases').without('seltype').with_content("# file managed by puppet\n") } + it { is_expected.to contain_exec('newaliases').with_refreshonly('true') } it { - should contain_file('/etc/postfix/master.cf').without('seltype').with_content( + is_expected.to contain_file('/etc/postfix/master.cf').without('seltype').with_content( /smtp inet n - - - - smtpd/ ).with_content( /amavis unix/ @@ -126,16 +126,16 @@ describe 'postfix' do /^submission inet n/ ) } - it { should contain_file('/etc/postfix/main.cf').without('seltype') } + it { is_expected.to contain_file('/etc/postfix/main.cf').without('seltype') } - it { should contain_postfix__config('myorigin').with_value('localhost') } - it { should contain_postfix__config('alias_maps').with_value('hash:/etc/aliases') } - it { should contain_postfix__config('inet_interfaces').with_value('localhost2') } + it { is_expected.to contain_postfix__config('myorigin').with_value('localhost') } + it { is_expected.to contain_postfix__config('alias_maps').with_value('hash:/etc/aliases') } + it { is_expected.to contain_postfix__config('inet_interfaces').with_value('localhost2') } - it { should contain_mailalias('root').with_recipient('foo') } + it { is_expected.to contain_mailalias('root').with_recipient('foo') } it { - should contain_service('postfix').with( + is_expected.to contain_service('postfix').with( :ensure => 'running', :enable => 'true', :hasstatus => 'true', @@ -158,7 +158,7 @@ describe 'postfix' do :inet_interfaces => 'localhost2' } } it 'should create a postfix::config defined type with inet_interfaces specified properly' do - should contain_postfix__config('inet_interfaces').with_value('localhost2') + is_expected.to contain_postfix__config('inet_interfaces').with_value('localhost2') end end context 'when enabling ldap' do @@ -171,7 +171,7 @@ describe 'postfix' do :mail_user => 'bar' } } it 'should adjust the content of /etc/postfix/master.cf specifying the user' do - should contain_file('/etc/postfix/master.cf').without('seltype').with_content(/user=bar/) + is_expected.to contain_file('/etc/postfix/master.cf').without('seltype').with_content(/user=bar/) end end context 'when mailman is true' do @@ -196,7 +196,7 @@ describe 'postfix' do -o smtpd_client_restrictions=check_client_access,hash:/etc/postfix/access,reject", } } it 'should update master.cf with the specified flags to smtp' do - should contain_file('/etc/postfix/master.cf').without('seltype').with_content( + is_expected.to contain_file('/etc/postfix/master.cf').without('seltype').with_content( /smtp inet n - - - - smtpd/).with_content( /^smtp.*\n.*smtpd_client_restrictions=check_client_access,hash:/ ) @@ -207,19 +207,19 @@ describe 'postfix' do :master_smtps => 'smtps inet n - - - - smtpd' } } it 'should update master.cf with the specified flags to smtps' do - should contain_file('/etc/postfix/master.cf').with_content(/^smtps inet n/) + is_expected.to contain_file('/etc/postfix/master.cf').with_content(/^smtps inet n/) end end context 'when mta is enabled' do let (:params) { { :mta => true, :mydestination => '1.2.3.4', :relayhost => '2.3.4.5' } } it 'should configure postfix as a minimal MTA, delivering mail to the mydestination param' do - should contain_postfix__config('mydestination').with_value('1.2.3.4') - should contain_postfix__config('mynetworks').with_value('127.0.0.0/8') - should contain_postfix__config('relayhost').with_value('2.3.4.5') - should contain_postfix__config('virtual_alias_maps').with_value('hash:/etc/postfix/virtual') - should contain_postfix__config('transport_maps').with_value('hash:/etc/postfix/transport') + is_expected.to contain_postfix__config('mydestination').with_value('1.2.3.4') + is_expected.to contain_postfix__config('mynetworks').with_value('127.0.0.0/8') + is_expected.to contain_postfix__config('relayhost').with_value('2.3.4.5') + is_expected.to contain_postfix__config('virtual_alias_maps').with_value('hash:/etc/postfix/virtual') + is_expected.to contain_postfix__config('transport_maps').with_value('hash:/etc/postfix/transport') end - it { should contain_class('postfix::mta') } + it { is_expected.to contain_class('postfix::mta') } context 'and satellite is also enabled' do let (:params) { { :mta => true, :satellite => true, :mydestination => '1.2.3.4', :relayhost => '2.3.4.5' } } it 'should fail' do @@ -240,7 +240,7 @@ describe 'postfix' do context 'when specifying myorigin' do let (:params) { { :myorigin => 'localhost'} } it 'should create a postfix::config defined type with myorigin specified properly' do - should contain_postfix__config('myorigin').with_value('localhost') + is_expected.to contain_postfix__config('myorigin').with_value('localhost') end end context 'when specifying relayhost' do @@ -251,7 +251,7 @@ describe 'postfix' do context 'when specifying a root_mail_recipient' do let (:params) { { :root_mail_recipient => 'foo'} } it 'should contain a Mailalias resource directing roots mail to the required user' do - should contain_mailalias('root').with_recipient('foo') + is_expected.to contain_mailalias('root').with_recipient('foo') end end context 'when specifying satellite' do @@ -260,11 +260,11 @@ describe 'postfix' do "class { 'augeas': }" end it 'should configure all local email to be forwarded to $root_mail_recipient delivered through $relayhost' do - should contain_postfix__config('mydestination').with_value('1.2.3.4') - should contain_postfix__config('mynetworks').with_value('127.0.0.0/8') - should contain_postfix__config('relayhost').with_value('2.3.4.5') - should contain_postfix__config('virtual_alias_maps').with_value('hash:/etc/postfix/virtual') - should contain_postfix__config('transport_maps').with_value('hash:/etc/postfix/transport') + is_expected.to contain_postfix__config('mydestination').with_value('1.2.3.4') + is_expected.to contain_postfix__config('mynetworks').with_value('127.0.0.0/8') + is_expected.to contain_postfix__config('relayhost').with_value('2.3.4.5') + is_expected.to contain_postfix__config('virtual_alias_maps').with_value('hash:/etc/postfix/virtual') + is_expected.to contain_postfix__config('transport_maps').with_value('hash:/etc/postfix/transport') end context 'and mta is also enabled' do let (:params) { { :mta => true, :satellite => true, :mydestination => '1.2.3.4', :relayhost => '2.3.4.5' } } @@ -282,25 +282,25 @@ describe 'postfix' do context 'when use_amavisd is true' do let (:params) { { :use_amavisd => true } } it 'should update master.cf with the specified flags to amavis' do - should contain_file('/etc/postfix/master.cf').with_content(/amavis unix/) + is_expected.to contain_file('/etc/postfix/master.cf').with_content(/amavis unix/) end end context 'when use_dovecot_lda is true' do let (:params) { { :use_dovecot_lda => true } } it 'should update master.cf with the specified flags to dovecot' do - should contain_file('/etc/postfix/master.cf').with_content(/dovecot.*\n.* user=vmail:vmail /) + is_expected.to contain_file('/etc/postfix/master.cf').with_content(/dovecot.*\n.* user=vmail:vmail /) end end context 'when use_schleuder is true' do let (:params) { { :use_schleuder => true } } it 'should update master.cf with the specified flags to schleuder' do - should contain_file('/etc/postfix/master.cf').with_content(/schleuder/) + is_expected.to contain_file('/etc/postfix/master.cf').with_content(/schleuder/) end end context 'when use_sympa is true' do let (:params) { { :use_sympa => true } } it 'should update master.cf to include sympa' do - should contain_file('/etc/postfix/master.cf').with_content(/sympa/) + is_expected.to contain_file('/etc/postfix/master.cf').with_content(/sympa/) end end end diff --git a/spec/defines/postfix_config_spec.rb b/spec/defines/postfix_config_spec.rb index 6dbc19b41a923b8821c18a0fbc260a15aff5166a..1a542224a582ea5335e026fec044d424393ee5f5 100644 --- a/spec/defines/postfix_config_spec.rb +++ b/spec/defines/postfix_config_spec.rb @@ -13,7 +13,7 @@ describe 'postfix::config' do context 'when not passing value' do it 'should fail' do expect { - should contain_augeas("set postfix 'foo'") + is_expected.to contain_augeas("set postfix 'foo'") }.to raise_error(Puppet::Error, /value can not be empty/) end end @@ -24,7 +24,7 @@ describe 'postfix::config' do } } it 'should fail' do expect { - should contain_augeas("set postfix 'foo'") + is_expected.to contain_augeas("set postfix 'foo'") }.to raise_error(Puppet::Error, /\["bar"\] is not a string/) end end @@ -36,7 +36,7 @@ describe 'postfix::config' do } } it 'should fail' do expect { - should contain_augeas("set postfix 'foo'") + is_expected.to contain_augeas("set postfix 'foo'") }.to raise_error(Puppet::Error, /\["present"\] is not a string/) end end @@ -48,7 +48,7 @@ describe 'postfix::config' do } } it 'should fail' do expect { - should contain_augeas("set postfix 'foo'") + is_expected.to contain_augeas("set postfix 'foo'") }.to raise_error(Puppet::Error, /must be either 'present', 'absent' or 'blank'/) end end @@ -59,7 +59,7 @@ describe 'postfix::config' do :ensure => 'present', } } - it { should contain_augeas("set postfix 'foo' to 'bar'").with( + it { is_expected.to contain_augeas("set postfix 'foo' to 'bar'").with( :incl => '/etc/postfix/main.cf', :lens => 'Postfix_Main.lns', :changes => "set foo 'bar'" @@ -72,7 +72,7 @@ describe 'postfix::config' do :ensure => 'absent', } } - it { should contain_augeas("rm postfix 'foo'").with( + it { is_expected.to contain_augeas("rm postfix 'foo'").with( :incl => '/etc/postfix/main.cf', :lens => 'Postfix_Main.lns', :changes => "rm foo" diff --git a/spec/defines/postfix_hash_spec.rb b/spec/defines/postfix_hash_spec.rb index 84d06192ec96a67804fa87c58bfc3484684c91d5..6a3220e84b003dc178ba4579dd45b5520c71e409 100644 --- a/spec/defines/postfix_hash_spec.rb +++ b/spec/defines/postfix_hash_spec.rb @@ -16,7 +16,7 @@ describe 'postfix::hash' do } } it 'should fail' do expect { - should contain_file('/tmp/foo') + is_expected.to contain_file('/tmp/foo') }.to raise_error(Puppet::Error, /\["present"\] is not a string/) end end @@ -27,7 +27,7 @@ describe 'postfix::hash' do } } it 'should fail' do expect { - should contain_file('/tmp/foo') + is_expected.to contain_file('/tmp/foo') }.to raise_error(Puppet::Error, /must be either 'present' or 'absent'/) end end @@ -36,7 +36,7 @@ describe 'postfix::hash' do let (:title) { 'foo' } it 'should fail' do expect { - should contain_file('/tmp/foo') + is_expected.to contain_file('/tmp/foo') }.to raise_error(Puppet::Error, /"foo" is not an absolute path/) end end @@ -49,7 +49,7 @@ describe 'postfix::hash' do it 'should fail' do expect { - should contain_file('/tmp/foo') + is_expected.to contain_file('/tmp/foo') }.to raise_error(Puppet::Error, /You must provide either 'source' or 'content'/) end end @@ -59,13 +59,13 @@ describe 'postfix::hash' do :source => '/tmp/bar', } } - it { should contain_file('/tmp/foo').with( + it { is_expected.to contain_file('/tmp/foo').with( :ensure => 'present', :source => '/tmp/bar' ).without(:content) } - it { should contain_file('/tmp/foo.db').with_ensure('present') } - it { should contain_exec('generate /tmp/foo.db') } + it { is_expected.to contain_file('/tmp/foo.db').with_ensure('present') } + it { is_expected.to contain_exec('generate /tmp/foo.db') } end context 'when passing content' do @@ -73,22 +73,22 @@ describe 'postfix::hash' do :content => 'bar', } } - it { should contain_file('/tmp/foo').with( + it { is_expected.to contain_file('/tmp/foo').with( :ensure => 'present', :content => 'bar' ).without(:source) } - it { should contain_file('/tmp/foo.db').with_ensure('present') } - it { should contain_exec('generate /tmp/foo.db') } + it { is_expected.to contain_file('/tmp/foo.db').with_ensure('present') } + it { is_expected.to contain_exec('generate /tmp/foo.db') } end context 'when not passing source or content' do - it { should contain_file('/tmp/foo').with( + it { is_expected.to contain_file('/tmp/foo').with( :ensure => 'present' ).without(:source).without(:content) } - it { should contain_file('/tmp/foo.db').with_ensure('present') } - it { should contain_exec('generate /tmp/foo.db') } + it { is_expected.to contain_file('/tmp/foo.db').with_ensure('present') } + it { is_expected.to contain_exec('generate /tmp/foo.db') } end context 'when ensuring absence' do @@ -96,8 +96,8 @@ describe 'postfix::hash' do :ensure => 'absent', } } - it { should contain_file('/tmp/foo').with_ensure('absent') } - it { should contain_file('/tmp/foo.db').with_ensure('absent') } - it { should contain_exec('generate /tmp/foo.db') } + it { is_expected.to contain_file('/tmp/foo').with_ensure('absent') } + it { is_expected.to contain_file('/tmp/foo.db').with_ensure('absent') } + it { is_expected.to contain_exec('generate /tmp/foo.db') } end end diff --git a/spec/defines/postfix_transport_spec.rb b/spec/defines/postfix_transport_spec.rb index cebec26bbaaffafe55b7a6f69b4cb103e980df47..ad497170eaff6abe6341d1870b560bab9440b6d9 100644 --- a/spec/defines/postfix_transport_spec.rb +++ b/spec/defines/postfix_transport_spec.rb @@ -19,7 +19,7 @@ describe 'postfix::transport' do it 'should fail' do expect { - should contain_augeas('Postfix transport - foo') + is_expected.to contain_augeas('Postfix transport - foo') }.to raise_error(Puppet::Error, /\["bar"\] is not a string/) end end @@ -32,7 +32,7 @@ describe 'postfix::transport' do it 'should fail' do expect { - should contain_augeas('Postfix transport - foo') + is_expected.to contain_augeas('Postfix transport - foo') }.to raise_error(Puppet::Error, /\["baz"\] is not a string/) end end @@ -45,7 +45,7 @@ describe 'postfix::transport' do it 'should fail' do expect { - should contain_augeas('Postfix transport - foo') + is_expected.to contain_augeas('Postfix transport - foo') }.to raise_error(Puppet::Error, /\["baz"\] is not a string/) end end @@ -58,7 +58,7 @@ describe 'postfix::transport' do it 'should fail' do expect { - should contain_augeas('Postfix transport - foo') + is_expected.to contain_augeas('Postfix transport - foo') }.to raise_error(Puppet::Error, /"baz" is not an absolute path/) end end @@ -71,7 +71,7 @@ describe 'postfix::transport' do it 'should fail' do expect { - should contain_augeas('Postfix transport - foo') + is_expected.to contain_augeas('Postfix transport - foo') }.to raise_error(Puppet::Error, /\["baz"\] is not a string/) end end @@ -84,14 +84,14 @@ describe 'postfix::transport' do it 'should fail' do expect { - should contain_augeas('Postfix transport - foo') + is_expected.to contain_augeas('Postfix transport - foo') }.to raise_error(Puppet::Error, /\$ensure must be either/) end end context 'when using default values' do - it { should contain_class('postfix::augeas') } - it { should contain_augeas('Postfix transport - foo').with( + it { is_expected.to contain_class('postfix::augeas') } + it { is_expected.to contain_augeas('Postfix transport - foo').with( :incl => '/etc/postfix/transport', :lens => 'Postfix_Transport.lns', :changes => [ @@ -110,8 +110,8 @@ describe 'postfix::transport' do :ensure => 'present', } } - it { should contain_class('postfix::augeas') } - it { should contain_augeas('Postfix transport - foo').with( + it { is_expected.to contain_class('postfix::augeas') } + it { is_expected.to contain_augeas('Postfix transport - foo').with( :incl => '/tmp/transport', :lens => 'Postfix_Transport.lns', :changes => [ @@ -128,8 +128,8 @@ describe 'postfix::transport' do :ensure => 'absent', } } - it { should contain_class('postfix::augeas') } - it { should contain_augeas('Postfix transport - foo').with( + it { is_expected.to contain_class('postfix::augeas') } + it { is_expected.to contain_augeas('Postfix transport - foo').with( :incl => '/etc/postfix/transport', :lens => 'Postfix_Transport.lns', :changes => [ diff --git a/spec/defines/postfix_virtual_spec.rb b/spec/defines/postfix_virtual_spec.rb index b058d7075999088116850cc4b529813615c6d776..36a056b2c42a5205ad7bcc3f6ff7abd872172a38 100644 --- a/spec/defines/postfix_virtual_spec.rb +++ b/spec/defines/postfix_virtual_spec.rb @@ -15,7 +15,7 @@ describe 'postfix::virtual' do context 'when not sending destination' do it 'should fail' do expect { - should contain_augeas('Postfix virtual - foo') + is_expected.to contain_augeas('Postfix virtual - foo') }.to raise_error(Puppet::Error, /Must pass destination/) end end @@ -27,7 +27,7 @@ describe 'postfix::virtual' do it 'should fail' do expect { - should contain_augeas('Postfix virtual - foo') + is_expected.to contain_augeas('Postfix virtual - foo') }.to raise_error(Puppet::Error, /\["bar"\] is not a string/) end end @@ -40,7 +40,7 @@ describe 'postfix::virtual' do it 'should fail' do expect { - should contain_augeas('Postfix virtual - foo') + is_expected.to contain_augeas('Postfix virtual - foo') }.to raise_error(Puppet::Error, /\["baz"\] is not a string/) end end @@ -53,7 +53,7 @@ describe 'postfix::virtual' do it 'should fail' do expect { - should contain_augeas('Postfix virtual - foo') + is_expected.to contain_augeas('Postfix virtual - foo') }.to raise_error(Puppet::Error, /"baz" is not an absolute path/) end end @@ -66,7 +66,7 @@ describe 'postfix::virtual' do it 'should fail' do expect { - should contain_augeas('Postfix virtual - foo') + is_expected.to contain_augeas('Postfix virtual - foo') }.to raise_error(Puppet::Error, /\["baz"\] is not a string/) end end @@ -79,7 +79,7 @@ describe 'postfix::virtual' do it 'should fail' do expect { - should contain_augeas('Postfix virtual - foo') + is_expected.to contain_augeas('Postfix virtual - foo') }.to raise_error(Puppet::Error, /\$ensure must be either/) end end @@ -89,8 +89,8 @@ describe 'postfix::virtual' do :destination => 'bar', } } - it { should contain_class('postfix::augeas') } - it { should contain_augeas('Postfix virtual - foo').with( + it { is_expected.to contain_class('postfix::augeas') } + it { is_expected.to contain_augeas('Postfix virtual - foo').with( :incl => '/etc/postfix/virtual', :lens => 'Postfix_Virtual.lns', :changes => [ @@ -107,8 +107,8 @@ describe 'postfix::virtual' do :ensure => 'present', } } - it { should contain_class('postfix::augeas') } - it { should contain_augeas('Postfix virtual - foo').with( + it { is_expected.to contain_class('postfix::augeas') } + it { is_expected.to contain_augeas('Postfix virtual - foo').with( :incl => '/tmp/virtual', :lens => 'Postfix_Virtual.lns', :changes => [ @@ -124,8 +124,8 @@ describe 'postfix::virtual' do :ensure => 'absent', } } - it { should contain_class('postfix::augeas') } - it { should contain_augeas('Postfix virtual - foo').with( + it { is_expected.to contain_class('postfix::augeas') } + it { is_expected.to contain_augeas('Postfix virtual - foo').with( :incl => '/etc/postfix/virtual', :lens => 'Postfix_Virtual.lns', :changes => [