diff --git a/spec/classes/apache_spec.rb b/spec/classes/apache_spec.rb
index f32fec808..55d71e039 100644
--- a/spec/classes/apache_spec.rb
+++ b/spec/classes/apache_spec.rb
@@ -14,16 +14,16 @@
:concat_basedir => '/dne',
}
end
- it { should contain_class("apache::params") }
- it { should contain_package("httpd").with(
+ it { is_expected.to contain_class("apache::params") }
+ it { is_expected.to contain_package("httpd").with(
'notify' => 'Class[Apache::Service]',
'ensure' => 'installed'
)
}
- it { should contain_user("www-data") }
- it { should contain_group("www-data") }
- it { should contain_class("apache::service") }
- it { should contain_file("/etc/apache2/sites-enabled").with(
+ it { is_expected.to contain_user("www-data") }
+ it { is_expected.to contain_group("www-data") }
+ it { is_expected.to contain_class("apache::service") }
+ it { is_expected.to contain_file("/etc/apache2/sites-enabled").with(
'ensure' => 'directory',
'recurse' => 'true',
'purge' => 'true',
@@ -31,7 +31,7 @@
'require' => 'Package[httpd]'
)
}
- it { should contain_file("/etc/apache2/mods-enabled").with(
+ it { is_expected.to contain_file("/etc/apache2/mods-enabled").with(
'ensure' => 'directory',
'recurse' => 'true',
'purge' => 'true',
@@ -39,7 +39,7 @@
'require' => 'Package[httpd]'
)
}
- it { should contain_file("/etc/apache2/mods-available").with(
+ it { is_expected.to contain_file("/etc/apache2/mods-available").with(
'ensure' => 'directory',
'recurse' => 'true',
'purge' => 'false',
@@ -47,7 +47,7 @@
'require' => 'Package[httpd]'
)
}
- it { should contain_concat("/etc/apache2/ports.conf").with(
+ it { is_expected.to contain_concat("/etc/apache2/ports.conf").with(
'owner' => 'root',
'group' => 'root',
'mode' => '0644',
@@ -65,17 +65,17 @@
'dav',
'env'
].each do |modname|
- it { should contain_file("#{modname}.load").with(
+ it { is_expected.to contain_file("#{modname}.load").with(
'path' => "/etc/apache2/mods-available/#{modname}.load",
'ensure' => 'file'
) }
- it { should contain_file("#{modname}.load symlink").with(
+ it { is_expected.to contain_file("#{modname}.load symlink").with(
'path' => "/etc/apache2/mods-enabled/#{modname}.load",
'ensure' => 'link',
'target' => "/etc/apache2/mods-available/#{modname}.load"
) }
- it { should_not contain_file("#{modname}.conf") }
- it { should_not contain_file("#{modname}.conf symlink") }
+ it { is_expected.not_to contain_file("#{modname}.conf") }
+ it { is_expected.not_to contain_file("#{modname}.conf symlink") }
end
context "with Apache version < 2.4" do
@@ -83,7 +83,7 @@
{ :apache_version => '2.2' }
end
- it { should contain_file("/etc/apache2/apache2.conf").with_content %r{^Include "/etc/apache2/conf\.d/\*\.conf"$} }
+ it { is_expected.to contain_file("/etc/apache2/apache2.conf").with_content %r{^Include "/etc/apache2/conf\.d/\*\.conf"$} }
end
context "with Apache version >= 2.4" do
@@ -91,7 +91,7 @@
{ :apache_version => '2.4' }
end
- it { should contain_file("/etc/apache2/apache2.conf").with_content %r{^IncludeOptional "/etc/apache2/conf\.d/\*\.conf"$} }
+ it { is_expected.to contain_file("/etc/apache2/apache2.conf").with_content %r{^IncludeOptional "/etc/apache2/conf\.d/\*\.conf"$} }
end
# Assert that both load files and conf files are placed and symlinked for these mods
@@ -105,20 +105,20 @@
'negotiation',
'setenvif',
].each do |modname|
- it { should contain_file("#{modname}.load").with(
+ it { is_expected.to contain_file("#{modname}.load").with(
'path' => "/etc/apache2/mods-available/#{modname}.load",
'ensure' => 'file'
) }
- it { should contain_file("#{modname}.load symlink").with(
+ it { is_expected.to contain_file("#{modname}.load symlink").with(
'path' => "/etc/apache2/mods-enabled/#{modname}.load",
'ensure' => 'link',
'target' => "/etc/apache2/mods-available/#{modname}.load"
) }
- it { should contain_file("#{modname}.conf").with(
+ it { is_expected.to contain_file("#{modname}.conf").with(
'path' => "/etc/apache2/mods-available/#{modname}.conf",
'ensure' => 'file'
) }
- it { should contain_file("#{modname}.conf symlink").with(
+ it { is_expected.to contain_file("#{modname}.conf symlink").with(
'path' => "/etc/apache2/mods-enabled/#{modname}.conf",
'ensure' => 'link',
'target' => "/etc/apache2/mods-available/#{modname}.conf"
@@ -131,8 +131,8 @@
{ :manage_user => false }
end
- it { should_not contain_user('www-data') }
- it { should contain_file("/etc/apache2/apache2.conf").with_content %r{^User www-data\n} }
+ it { is_expected.not_to contain_user('www-data') }
+ it { is_expected.to contain_file("/etc/apache2/apache2.conf").with_content %r{^User www-data\n} }
end
end
describe "Don't create group resource" do
@@ -141,8 +141,8 @@
{ :manage_group => false }
end
- it { should_not contain_group('www-data') }
- it { should contain_file("/etc/apache2/apache2.conf").with_content %r{^Group www-data\n} }
+ it { is_expected.not_to contain_group('www-data') }
+ it { is_expected.to contain_file("/etc/apache2/apache2.conf").with_content %r{^Group www-data\n} }
end
end
@@ -155,8 +155,8 @@
} }
end
- it { should contain_file("/etc/apache2/apache2.conf").with_content %r{^LogFormat "%v %h %l %u %t \"%r\" %>s %b" vhost_common\n} }
- it { should contain_file("/etc/apache2/apache2.conf").with_content %r{^LogFormat "%v %h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\"" vhost_combined\n} }
+ it { is_expected.to contain_file("/etc/apache2/apache2.conf").with_content %r{^LogFormat "%v %h %l %u %t \"%r\" %>s %b" vhost_common\n} }
+ it { is_expected.to contain_file("/etc/apache2/apache2.conf").with_content %r{^LogFormat "%v %h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\"" vhost_combined\n} }
end
end
@@ -174,7 +174,7 @@
:operatingsystemrelease => '13.10'
})
end
- it { should contain_class('apache').with_apache_version('2.4') }
+ it { is_expected.to contain_class('apache').with_apache_version('2.4') }
end
context "12.04" do
let :facts do
@@ -183,7 +183,7 @@
:operatingsystemrelease => '12.04'
})
end
- it { should contain_class('apache').with_apache_version('2.2') }
+ it { is_expected.to contain_class('apache').with_apache_version('2.2') }
end
context "13.04" do
let :facts do
@@ -192,7 +192,7 @@
:operatingsystemrelease => '13.04'
})
end
- it { should contain_class('apache').with_apache_version('2.2') }
+ it { is_expected.to contain_class('apache').with_apache_version('2.2') }
end
end
end
@@ -208,16 +208,16 @@
:path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
}
end
- it { should contain_class("apache::params") }
- it { should contain_package("httpd").with(
+ it { is_expected.to contain_class("apache::params") }
+ it { is_expected.to contain_package("httpd").with(
'notify' => 'Class[Apache::Service]',
'ensure' => 'installed'
)
}
- it { should contain_user("apache") }
- it { should contain_group("apache") }
- it { should contain_class("apache::service") }
- it { should contain_file("/etc/httpd/conf.d").with(
+ it { is_expected.to contain_user("apache") }
+ it { is_expected.to contain_group("apache") }
+ it { is_expected.to contain_class("apache::service") }
+ it { is_expected.to contain_file("/etc/httpd/conf.d").with(
'ensure' => 'directory',
'recurse' => 'true',
'purge' => 'true',
@@ -225,7 +225,7 @@
'require' => 'Package[httpd]'
)
}
- it { should contain_concat("/etc/httpd/conf/ports.conf").with(
+ it { is_expected.to contain_concat("/etc/httpd/conf/ports.conf").with(
'owner' => 'root',
'group' => 'root',
'mode' => '0644',
@@ -242,7 +242,7 @@
end
['mod.d','site.d','conf.d'].each do |dir|
- it { should contain_file("/etc/httpd/#{dir}").with(
+ it { is_expected.to contain_file("/etc/httpd/#{dir}").with(
'ensure' => 'directory',
'recurse' => 'true',
'purge' => 'true',
@@ -262,10 +262,10 @@
'dav',
'env',
].each do |modname|
- it { should contain_file("#{modname}.load").with_path(
+ it { is_expected.to contain_file("#{modname}.load").with_path(
"/etc/httpd/mod.d/#{modname}.load"
) }
- it { should_not contain_file("#{modname}.conf").with_path(
+ it { is_expected.not_to contain_file("#{modname}.conf").with_path(
"/etc/httpd/mod.d/#{modname}.conf"
) }
end
@@ -281,10 +281,10 @@
'negotiation',
'setenvif',
].each do |modname|
- it { should contain_file("#{modname}.load").with_path(
+ it { is_expected.to contain_file("#{modname}.load").with_path(
"/etc/httpd/mod.d/#{modname}.load"
) }
- it { should contain_file("#{modname}.conf").with_path(
+ it { is_expected.to contain_file("#{modname}.conf").with_path(
"/etc/httpd/mod.d/#{modname}.conf"
) }
end
@@ -294,7 +294,7 @@
{ :apache_version => '2.2' }
end
- it { should contain_file("/etc/httpd/conf/httpd.conf").with_content %r{^Include "/etc/httpd/conf\.d/\*\.conf"$} }
+ it { is_expected.to contain_file("/etc/httpd/conf/httpd.conf").with_content %r{^Include "/etc/httpd/conf\.d/\*\.conf"$} }
end
context "with Apache version >= 2.4" do
@@ -302,12 +302,12 @@
{ :apache_version => '2.4' }
end
- it { should contain_file("/etc/httpd/conf/httpd.conf").with_content %r{^IncludeOptional "/etc/httpd/conf\.d/\*\.conf"$} }
+ it { is_expected.to contain_file("/etc/httpd/conf/httpd.conf").with_content %r{^IncludeOptional "/etc/httpd/conf\.d/\*\.conf"$} }
end
- it { should contain_file("/etc/httpd/conf/httpd.conf").with_content %r{^Include "/etc/httpd/site\.d/\*"$} }
- it { should contain_file("/etc/httpd/conf/httpd.conf").with_content %r{^Include "/etc/httpd/mod\.d/\*\.conf"$} }
- it { should contain_file("/etc/httpd/conf/httpd.conf").with_content %r{^Include "/etc/httpd/mod\.d/\*\.load"$} }
+ it { is_expected.to contain_file("/etc/httpd/conf/httpd.conf").with_content %r{^Include "/etc/httpd/site\.d/\*"$} }
+ it { is_expected.to contain_file("/etc/httpd/conf/httpd.conf").with_content %r{^Include "/etc/httpd/mod\.d/\*\.conf"$} }
+ it { is_expected.to contain_file("/etc/httpd/conf/httpd.conf").with_content %r{^Include "/etc/httpd/mod\.d/\*\.load"$} }
end
describe "Alternate conf.d directory" do
@@ -315,7 +315,7 @@
{ :confd_dir => '/etc/httpd/special_conf.d' }
end
- it { should contain_file("/etc/httpd/special_conf.d").with(
+ it { is_expected.to contain_file("/etc/httpd/special_conf.d").with(
'ensure' => 'directory',
'recurse' => 'true',
'purge' => 'true',
@@ -330,32 +330,32 @@
{ :mpm_module => false }
end
it 'should not declare mpm modules' do
- should_not contain_class('apache::mod::event')
- should_not contain_class('apache::mod::itk')
- should_not contain_class('apache::mod::peruser')
- should_not contain_class('apache::mod::prefork')
- should_not contain_class('apache::mod::worker')
+ is_expected.not_to contain_class('apache::mod::event')
+ is_expected.not_to contain_class('apache::mod::itk')
+ is_expected.not_to contain_class('apache::mod::peruser')
+ is_expected.not_to contain_class('apache::mod::prefork')
+ is_expected.not_to contain_class('apache::mod::worker')
end
end
context "when declaring mpm_module => prefork" do
let :params do
{ :mpm_module => 'prefork' }
end
- it { should contain_class('apache::mod::prefork') }
- it { should_not contain_class('apache::mod::event') }
- it { should_not contain_class('apache::mod::itk') }
- it { should_not contain_class('apache::mod::peruser') }
- it { should_not contain_class('apache::mod::worker') }
+ it { is_expected.to contain_class('apache::mod::prefork') }
+ it { is_expected.not_to contain_class('apache::mod::event') }
+ it { is_expected.not_to contain_class('apache::mod::itk') }
+ it { is_expected.not_to contain_class('apache::mod::peruser') }
+ it { is_expected.not_to contain_class('apache::mod::worker') }
end
context "when declaring mpm_module => worker" do
let :params do
{ :mpm_module => 'worker' }
end
- it { should contain_class('apache::mod::worker') }
- it { should_not contain_class('apache::mod::event') }
- it { should_not contain_class('apache::mod::itk') }
- it { should_not contain_class('apache::mod::peruser') }
- it { should_not contain_class('apache::mod::prefork') }
+ it { is_expected.to contain_class('apache::mod::worker') }
+ it { is_expected.not_to contain_class('apache::mod::event') }
+ it { is_expected.not_to contain_class('apache::mod::itk') }
+ it { is_expected.not_to contain_class('apache::mod::peruser') }
+ it { is_expected.not_to contain_class('apache::mod::prefork') }
end
context "when declaring mpm_module => breakme" do
let :params do
@@ -370,13 +370,13 @@
let :params do
{ :conf_template => 'apache/httpd.conf.erb' }
end
- it { should contain_file("/etc/httpd/conf/httpd.conf").with_content %r{^# Security\n} }
+ it { is_expected.to contain_file("/etc/httpd/conf/httpd.conf").with_content %r{^# Security\n} }
end
context "with non-default" do
let :params do
{ :conf_template => 'site_apache/fake.conf.erb' }
end
- it { should contain_file("/etc/httpd/conf/httpd.conf").with_content %r{^Fake template for rspec.$} }
+ it { is_expected.to contain_file("/etc/httpd/conf/httpd.conf").with_content %r{^Fake template for rspec.$} }
end
end
@@ -386,8 +386,8 @@
{ :default_mods => false }
end
- it { should contain_apache__mod('authz_host') }
- it { should_not contain_apache__mod('env') }
+ it { is_expected.to contain_apache__mod('authz_host') }
+ it { is_expected.not_to contain_apache__mod('env') }
end
context "custom" do
let :params do
@@ -401,10 +401,10 @@
]}
end
- it { should contain_apache__mod('authz_host') }
- it { should contain_apache__mod('env') }
- it { should contain_class('apache::mod::info') }
- it { should contain_class('apache::mod::mime') }
+ it { is_expected.to contain_apache__mod('authz_host') }
+ it { is_expected.to contain_apache__mod('env') }
+ it { is_expected.to contain_class('apache::mod::info') }
+ it { is_expected.to contain_class('apache::mod::mime') }
end
end
describe "Don't create user resource" do
@@ -413,8 +413,8 @@
{ :manage_user => false }
end
- it { should_not contain_user('apache') }
- it { should contain_file("/etc/httpd/conf/httpd.conf").with_content %r{^User apache\n} }
+ it { is_expected.not_to contain_user('apache') }
+ it { is_expected.to contain_file("/etc/httpd/conf/httpd.conf").with_content %r{^User apache\n} }
end
end
describe "Don't create group resource" do
@@ -423,8 +423,8 @@
{ :manage_group => false }
end
- it { should_not contain_group('apache') }
- it { should contain_file("/etc/httpd/conf/httpd.conf").with_content %r{^Group apache\n} }
+ it { is_expected.not_to contain_group('apache') }
+ it { is_expected.to contain_file("/etc/httpd/conf/httpd.conf").with_content %r{^Group apache\n} }
end
end
@@ -443,13 +443,13 @@
let :params do
{ :sendfile => 'On' }
end
- it { should contain_file("/etc/httpd/conf/httpd.conf").with_content %r{^EnableSendfile On\n} }
+ it { is_expected.to contain_file("/etc/httpd/conf/httpd.conf").with_content %r{^EnableSendfile On\n} }
end
context "Off" do
let :params do
{ :sendfile => 'Off' }
end
- it { should contain_file("/etc/httpd/conf/httpd.conf").with_content %r{^EnableSendfile Off\n} }
+ it { is_expected.to contain_file("/etc/httpd/conf/httpd.conf").with_content %r{^EnableSendfile Off\n} }
end
end
end
@@ -465,26 +465,26 @@
:path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
}
end
- it { should contain_class("apache::params") }
- it { should contain_class("apache::package").with({'ensure' => 'present'}) }
- it { should contain_user("www") }
- it { should contain_group("www") }
- it { should contain_class("apache::service") }
- it { should contain_file("/usr/local/etc/apache22/Vhosts").with(
+ it { is_expected.to contain_class("apache::params") }
+ it { is_expected.to contain_class("apache::package").with({'ensure' => 'present'}) }
+ it { is_expected.to contain_user("www") }
+ it { is_expected.to contain_group("www") }
+ it { is_expected.to contain_class("apache::service") }
+ it { is_expected.to contain_file("/usr/local/etc/apache22/Vhosts").with(
'ensure' => 'directory',
'recurse' => 'true',
'purge' => 'true',
'notify' => 'Class[Apache::Service]',
'require' => 'Package[httpd]'
) }
- it { should contain_file("/usr/local/etc/apache22/Modules").with(
+ it { is_expected.to contain_file("/usr/local/etc/apache22/Modules").with(
'ensure' => 'directory',
'recurse' => 'true',
'purge' => 'true',
'notify' => 'Class[Apache::Service]',
'require' => 'Package[httpd]'
) }
- it { should contain_concat("/usr/local/etc/apache22/ports.conf").with(
+ it { is_expected.to contain_concat("/usr/local/etc/apache22/ports.conf").with(
'owner' => 'root',
'group' => 'wheel',
'mode' => '0644',
@@ -501,11 +501,11 @@
'dav',
'env'
].each do |modname|
- it { should contain_file("#{modname}.load").with(
+ it { is_expected.to contain_file("#{modname}.load").with(
'path' => "/usr/local/etc/apache22/Modules/#{modname}.load",
'ensure' => 'file'
) }
- it { should_not contain_file("#{modname}.conf") }
+ it { is_expected.not_to contain_file("#{modname}.conf") }
end
# Assert that both load files and conf files are placed for these mods
@@ -519,11 +519,11 @@
'negotiation',
'setenvif',
].each do |modname|
- it { should contain_file("#{modname}.load").with(
+ it { is_expected.to contain_file("#{modname}.load").with(
'path' => "/usr/local/etc/apache22/Modules/#{modname}.load",
'ensure' => 'file'
) }
- it { should contain_file("#{modname}.conf").with(
+ it { is_expected.to contain_file("#{modname}.conf").with(
'path' => "/usr/local/etc/apache22/Modules/#{modname}.conf",
'ensure' => 'file'
) }
@@ -542,22 +542,22 @@
}
end
context 'default vhost defaults' do
- it { should contain_apache__vhost('default').with_ensure('present') }
- it { should contain_apache__vhost('default-ssl').with_ensure('absent') }
+ it { is_expected.to contain_apache__vhost('default').with_ensure('present') }
+ it { is_expected.to contain_apache__vhost('default-ssl').with_ensure('absent') }
end
context 'without default non-ssl vhost' do
let :params do {
:default_vhost => false
}
end
- it { should contain_apache__vhost('default').with_ensure('absent') }
+ it { is_expected.to contain_apache__vhost('default').with_ensure('absent') }
end
context 'with default ssl vhost' do
let :params do {
:default_ssl_vhost => true
}
end
- it { should contain_apache__vhost('default-ssl').with_ensure('present') }
+ it { is_expected.to contain_apache__vhost('default-ssl').with_ensure('present') }
end
end
end
diff --git a/spec/classes/dev_spec.rb b/spec/classes/dev_spec.rb
index eceadca4a..df342d40e 100644
--- a/spec/classes/dev_spec.rb
+++ b/spec/classes/dev_spec.rb
@@ -10,10 +10,10 @@
:operatingsystemrelease => '6',
}
end
- it { should contain_class("apache::params") }
- it { should contain_package("libaprutil1-dev") }
- it { should contain_package("libapr1-dev") }
- it { should contain_package("apache2-prefork-dev") }
+ it { is_expected.to contain_class("apache::params") }
+ it { is_expected.to contain_package("libaprutil1-dev") }
+ it { is_expected.to contain_package("libapr1-dev") }
+ it { is_expected.to contain_package("apache2-prefork-dev") }
end
context "on a RedHat OS" do
let :facts do
@@ -23,8 +23,8 @@
:operatingsystemrelease => '6',
}
end
- it { should contain_class("apache::params") }
- it { should contain_package("httpd-devel") }
+ it { is_expected.to contain_class("apache::params") }
+ it { is_expected.to contain_package("httpd-devel") }
end
context "on a FreeBSD OS" do
let :pre_condition do
@@ -37,6 +37,6 @@
:operatingsystemrelease => '9',
}
end
- it { should contain_class("apache::params") }
+ it { is_expected.to contain_class("apache::params") }
end
end
diff --git a/spec/classes/mod/auth_kerb_spec.rb b/spec/classes/mod/auth_kerb_spec.rb
index 6e2c16b7e..1706bfb8d 100644
--- a/spec/classes/mod/auth_kerb_spec.rb
+++ b/spec/classes/mod/auth_kerb_spec.rb
@@ -17,9 +17,9 @@
:concat_basedir => '/dne',
}
end
- it { should contain_class("apache::params") }
- it { should contain_apache__mod("auth_kerb") }
- it { should contain_package("libapache2-mod-auth-kerb") }
+ it { is_expected.to contain_class("apache::params") }
+ it { is_expected.to contain_apache__mod("auth_kerb") }
+ it { is_expected.to contain_package("libapache2-mod-auth-kerb") }
end
context "on a RedHat OS", :compile do
let :facts do
@@ -33,9 +33,9 @@
:concat_basedir => '/dne',
}
end
- it { should contain_class("apache::params") }
- it { should contain_apache__mod("auth_kerb") }
- it { should contain_package("mod_auth_kerb") }
+ it { is_expected.to contain_class("apache::params") }
+ it { is_expected.to contain_apache__mod("auth_kerb") }
+ it { is_expected.to contain_package("mod_auth_kerb") }
end
context "on a FreeBSD OS", :compile do
let :facts do
@@ -49,8 +49,8 @@
:concat_basedir => '/dne',
}
end
- it { should contain_class("apache::params") }
- it { should contain_apache__mod("auth_kerb") }
- it { should contain_package("www/mod_auth_kerb2") }
+ it { is_expected.to contain_class("apache::params") }
+ it { is_expected.to contain_apache__mod("auth_kerb") }
+ it { is_expected.to contain_package("www/mod_auth_kerb2") }
end
end
diff --git a/spec/classes/mod/authnz_ldap_spec.rb b/spec/classes/mod/authnz_ldap_spec.rb
index d9ca5398b..a0a913a6e 100644
--- a/spec/classes/mod/authnz_ldap_spec.rb
+++ b/spec/classes/mod/authnz_ldap_spec.rb
@@ -18,23 +18,23 @@
:path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
}
end
- it { should contain_class("apache::params") }
- it { should contain_class("apache::mod::ldap") }
- it { should contain_apache__mod('authnz_ldap') }
+ it { is_expected.to contain_class("apache::params") }
+ it { is_expected.to contain_class("apache::mod::ldap") }
+ it { is_expected.to contain_apache__mod('authnz_ldap') }
context 'default verifyServerCert' do
- it { should contain_file('authnz_ldap.conf').with_content(/^LDAPVerifyServerCert On$/) }
+ it { is_expected.to contain_file('authnz_ldap.conf').with_content(/^LDAPVerifyServerCert On$/) }
end
context 'verifyServerCert = false' do
let(:params) { { :verifyServerCert => false } }
- it { should contain_file('authnz_ldap.conf').with_content(/^LDAPVerifyServerCert Off$/) }
+ it { is_expected.to contain_file('authnz_ldap.conf').with_content(/^LDAPVerifyServerCert Off$/) }
end
context 'verifyServerCert = wrong' do
let(:params) { { :verifyServerCert => 'wrong' } }
it 'should raise an error' do
- expect { should raise_error Puppet::Error }
+ expect { is_expected.to raise_error Puppet::Error }
end
end
end #Debian
@@ -51,23 +51,23 @@
:path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
}
end
- it { should contain_class("apache::params") }
- it { should contain_class("apache::mod::ldap") }
- it { should contain_apache__mod('authnz_ldap') }
+ it { is_expected.to contain_class("apache::params") }
+ it { is_expected.to contain_class("apache::mod::ldap") }
+ it { is_expected.to contain_apache__mod('authnz_ldap') }
context 'default verifyServerCert' do
- it { should contain_file('authnz_ldap.conf').with_content(/^LDAPVerifyServerCert On$/) }
+ it { is_expected.to contain_file('authnz_ldap.conf').with_content(/^LDAPVerifyServerCert On$/) }
end
context 'verifyServerCert = false' do
let(:params) { { :verifyServerCert => false } }
- it { should contain_file('authnz_ldap.conf').with_content(/^LDAPVerifyServerCert Off$/) }
+ it { is_expected.to contain_file('authnz_ldap.conf').with_content(/^LDAPVerifyServerCert Off$/) }
end
context 'verifyServerCert = wrong' do
let(:params) { { :verifyServerCert => 'wrong' } }
it 'should raise an error' do
- expect { should raise_error Puppet::Error }
+ expect { is_expected.to raise_error Puppet::Error }
end
end
end # Redhat
diff --git a/spec/classes/mod/dav_svn_spec.rb b/spec/classes/mod/dav_svn_spec.rb
index 4898cdece..859174af7 100644
--- a/spec/classes/mod/dav_svn_spec.rb
+++ b/spec/classes/mod/dav_svn_spec.rb
@@ -17,9 +17,9 @@
:path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
}
end
- it { should contain_class("apache::params") }
- it { should contain_apache__mod('dav_svn') }
- it { should contain_package("libapache2-svn") }
+ it { is_expected.to contain_class("apache::params") }
+ it { is_expected.to contain_apache__mod('dav_svn') }
+ it { is_expected.to contain_package("libapache2-svn") }
end
context "on a RedHat OS" do
let :facts do
@@ -33,9 +33,9 @@
:path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
}
end
- it { should contain_class("apache::params") }
- it { should contain_apache__mod('dav_svn') }
- it { should contain_package("mod_dav_svn") }
+ it { is_expected.to contain_class("apache::params") }
+ it { is_expected.to contain_apache__mod('dav_svn') }
+ it { is_expected.to contain_package("mod_dav_svn") }
end
context "on a FreeBSD OS" do
let :facts do
@@ -49,8 +49,8 @@
:path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
}
end
- it { should contain_class("apache::params") }
- it { should contain_apache__mod('dav_svn') }
- it { should contain_package("devel/subversion") }
+ it { is_expected.to contain_class("apache::params") }
+ it { is_expected.to contain_apache__mod('dav_svn') }
+ it { is_expected.to contain_package("devel/subversion") }
end
end
diff --git a/spec/classes/mod/deflate_spec.rb b/spec/classes/mod/deflate_spec.rb
index f8eb88101..227c97a82 100644
--- a/spec/classes/mod/deflate_spec.rb
+++ b/spec/classes/mod/deflate_spec.rb
@@ -2,10 +2,10 @@
# This function is called inside the OS specific contexts
def general_deflate_specs
- it { should contain_apache__mod("deflate") }
+ it { is_expected.to contain_apache__mod("deflate") }
it do
- should contain_file("deflate.conf").with_content(
+ is_expected.to contain_file("deflate.conf").with_content(
"AddOutputFilterByType DEFLATE text/html text/plain text/xml\n"\
"AddOutputFilterByType DEFLATE text/css\n"\
"AddOutputFilterByType DEFLATE application/x-javascript application/javascript application/ecmascript\n"\
@@ -39,11 +39,11 @@ def general_deflate_specs
# Load the more generic tests for this context
general_deflate_specs()
- it { should contain_file("deflate.conf").with({
+ it { is_expected.to contain_file("deflate.conf").with({
:ensure => 'file',
:path => '/etc/apache2/mods-available/deflate.conf',
} ) }
- it { should contain_file("deflate.conf symlink").with({
+ it { is_expected.to contain_file("deflate.conf symlink").with({
:ensure => 'link',
:path => '/etc/apache2/mods-enabled/deflate.conf',
} ) }
@@ -64,7 +64,7 @@ def general_deflate_specs
# Load the more generic tests for this context
general_deflate_specs()
- it { should contain_file("deflate.conf").with_path("/etc/httpd/conf.d/deflate.conf") }
+ it { is_expected.to contain_file("deflate.conf").with_path("/etc/httpd/conf.d/deflate.conf") }
end
context "On a FreeBSD OS with default params" do
@@ -82,7 +82,7 @@ def general_deflate_specs
# Load the more generic tests for this context
general_deflate_specs()
- it { should contain_file("deflate.conf").with({
+ it { is_expected.to contain_file("deflate.conf").with({
:ensure => 'file',
:path => '/usr/local/etc/apache22/Modules/deflate.conf',
} ) }
diff --git a/spec/classes/mod/dev_spec.rb b/spec/classes/mod/dev_spec.rb
index 0de62afcb..84d80e344 100644
--- a/spec/classes/mod/dev_spec.rb
+++ b/spec/classes/mod/dev_spec.rb
@@ -20,7 +20,7 @@
:operatingsystemrelease => operatingsystemrelease,
}
end
- it { should contain_class('apache::dev') }
+ it { is_expected.to contain_class('apache::dev') }
end
end
end
diff --git a/spec/classes/mod/dir_spec.rb b/spec/classes/mod/dir_spec.rb
index 8bcdc0b6b..1efed2fe7 100644
--- a/spec/classes/mod/dir_spec.rb
+++ b/spec/classes/mod/dir_spec.rb
@@ -20,22 +20,22 @@
}
end
context "passing no parameters" do
- it { should contain_class("apache::params") }
- it { should contain_apache__mod('dir') }
- it { should contain_file('dir.conf').with_content(/^DirectoryIndex /) }
- it { should contain_file('dir.conf').with_content(/ index\.html /) }
- it { should contain_file('dir.conf').with_content(/ index\.html\.var /) }
- it { should contain_file('dir.conf').with_content(/ index\.cgi /) }
- it { should contain_file('dir.conf').with_content(/ index\.pl /) }
- it { should contain_file('dir.conf').with_content(/ index\.php /) }
- it { should contain_file('dir.conf').with_content(/ index\.xhtml$/) }
+ it { is_expected.to contain_class("apache::params") }
+ it { is_expected.to contain_apache__mod('dir') }
+ it { is_expected.to contain_file('dir.conf').with_content(/^DirectoryIndex /) }
+ it { is_expected.to contain_file('dir.conf').with_content(/ index\.html /) }
+ it { is_expected.to contain_file('dir.conf').with_content(/ index\.html\.var /) }
+ it { is_expected.to contain_file('dir.conf').with_content(/ index\.cgi /) }
+ it { is_expected.to contain_file('dir.conf').with_content(/ index\.pl /) }
+ it { is_expected.to contain_file('dir.conf').with_content(/ index\.php /) }
+ it { is_expected.to contain_file('dir.conf').with_content(/ index\.xhtml$/) }
end
context "passing indexes => ['example.txt','fearsome.aspx']" do
let :params do
{:indexes => ['example.txt','fearsome.aspx']}
end
- it { should contain_file('dir.conf').with_content(/ example\.txt /) }
- it { should contain_file('dir.conf').with_content(/ fearsome\.aspx$/) }
+ it { is_expected.to contain_file('dir.conf').with_content(/ example\.txt /) }
+ it { is_expected.to contain_file('dir.conf').with_content(/ fearsome\.aspx$/) }
end
end
context "on a RedHat OS" do
@@ -51,22 +51,22 @@
}
end
context "passing no parameters" do
- it { should contain_class("apache::params") }
- it { should contain_apache__mod('dir') }
- it { should contain_file('dir.conf').with_content(/^DirectoryIndex /) }
- it { should contain_file('dir.conf').with_content(/ index\.html /) }
- it { should contain_file('dir.conf').with_content(/ index\.html\.var /) }
- it { should contain_file('dir.conf').with_content(/ index\.cgi /) }
- it { should contain_file('dir.conf').with_content(/ index\.pl /) }
- it { should contain_file('dir.conf').with_content(/ index\.php /) }
- it { should contain_file('dir.conf').with_content(/ index\.xhtml$/) }
+ it { is_expected.to contain_class("apache::params") }
+ it { is_expected.to contain_apache__mod('dir') }
+ it { is_expected.to contain_file('dir.conf').with_content(/^DirectoryIndex /) }
+ it { is_expected.to contain_file('dir.conf').with_content(/ index\.html /) }
+ it { is_expected.to contain_file('dir.conf').with_content(/ index\.html\.var /) }
+ it { is_expected.to contain_file('dir.conf').with_content(/ index\.cgi /) }
+ it { is_expected.to contain_file('dir.conf').with_content(/ index\.pl /) }
+ it { is_expected.to contain_file('dir.conf').with_content(/ index\.php /) }
+ it { is_expected.to contain_file('dir.conf').with_content(/ index\.xhtml$/) }
end
context "passing indexes => ['example.txt','fearsome.aspx']" do
let :params do
{:indexes => ['example.txt','fearsome.aspx']}
end
- it { should contain_file('dir.conf').with_content(/ example\.txt /) }
- it { should contain_file('dir.conf').with_content(/ fearsome\.aspx$/) }
+ it { is_expected.to contain_file('dir.conf').with_content(/ example\.txt /) }
+ it { is_expected.to contain_file('dir.conf').with_content(/ fearsome\.aspx$/) }
end
end
context "on a FreeBSD OS" do
@@ -82,22 +82,22 @@
}
end
context "passing no parameters" do
- it { should contain_class("apache::params") }
- it { should contain_apache__mod('dir') }
- it { should contain_file('dir.conf').with_content(/^DirectoryIndex /) }
- it { should contain_file('dir.conf').with_content(/ index\.html /) }
- it { should contain_file('dir.conf').with_content(/ index\.html\.var /) }
- it { should contain_file('dir.conf').with_content(/ index\.cgi /) }
- it { should contain_file('dir.conf').with_content(/ index\.pl /) }
- it { should contain_file('dir.conf').with_content(/ index\.php /) }
- it { should contain_file('dir.conf').with_content(/ index\.xhtml$/) }
+ it { is_expected.to contain_class("apache::params") }
+ it { is_expected.to contain_apache__mod('dir') }
+ it { is_expected.to contain_file('dir.conf').with_content(/^DirectoryIndex /) }
+ it { is_expected.to contain_file('dir.conf').with_content(/ index\.html /) }
+ it { is_expected.to contain_file('dir.conf').with_content(/ index\.html\.var /) }
+ it { is_expected.to contain_file('dir.conf').with_content(/ index\.cgi /) }
+ it { is_expected.to contain_file('dir.conf').with_content(/ index\.pl /) }
+ it { is_expected.to contain_file('dir.conf').with_content(/ index\.php /) }
+ it { is_expected.to contain_file('dir.conf').with_content(/ index\.xhtml$/) }
end
context "passing indexes => ['example.txt','fearsome.aspx']" do
let :params do
{:indexes => ['example.txt','fearsome.aspx']}
end
- it { should contain_file('dir.conf').with_content(/ example\.txt /) }
- it { should contain_file('dir.conf').with_content(/ fearsome\.aspx$/) }
+ it { is_expected.to contain_file('dir.conf').with_content(/ example\.txt /) }
+ it { is_expected.to contain_file('dir.conf').with_content(/ fearsome\.aspx$/) }
end
end
end
diff --git a/spec/classes/mod/event_spec.rb b/spec/classes/mod/event_spec.rb
index 850bd5c55..3061ca9b1 100644
--- a/spec/classes/mod/event_spec.rb
+++ b/spec/classes/mod/event_spec.rb
@@ -16,9 +16,9 @@
:path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
}
end
- it { should contain_class("apache::params") }
- it { should_not contain_apache__mod('event') }
- it { should contain_file("/usr/local/etc/apache22/Modules/event.conf").with_ensure('file') }
+ it { is_expected.to contain_class("apache::params") }
+ it { is_expected.not_to contain_apache__mod('event') }
+ it { is_expected.to contain_file("/usr/local/etc/apache22/Modules/event.conf").with_ensure('file') }
end
context "on a Debian OS" do
let :facts do
@@ -34,10 +34,10 @@
}
end
- it { should contain_class("apache::params") }
- it { should_not contain_apache__mod('event') }
- it { should contain_file("/etc/apache2/mods-available/event.conf").with_ensure('file') }
- it { should contain_file("/etc/apache2/mods-enabled/event.conf").with_ensure('link') }
+ it { is_expected.to contain_class("apache::params") }
+ it { is_expected.not_to contain_apache__mod('event') }
+ it { is_expected.to contain_file("/etc/apache2/mods-available/event.conf").with_ensure('file') }
+ it { is_expected.to contain_file("/etc/apache2/mods-enabled/event.conf").with_ensure('link') }
context "with Apache version < 2.4" do
let :params do
@@ -46,10 +46,10 @@
}
end
- it { should_not contain_file("/etc/apache2/mods-available/event.load") }
- it { should_not contain_file("/etc/apache2/mods-enabled/event.load") }
+ it { is_expected.not_to contain_file("/etc/apache2/mods-available/event.load") }
+ it { is_expected.not_to contain_file("/etc/apache2/mods-enabled/event.load") }
- it { should contain_package("apache2-mpm-event") }
+ it { is_expected.to contain_package("apache2-mpm-event") }
end
context "with Apache version >= 2.4" do
@@ -59,12 +59,12 @@
}
end
- it { should contain_file("/etc/apache2/mods-available/event.load").with({
+ it { is_expected.to contain_file("/etc/apache2/mods-available/event.load").with({
'ensure' => 'file',
'content' => "LoadModule mpm_event_module /usr/lib/apache2/modules/mod_mpm_event.so\n"
})
}
- it { should contain_file("/etc/apache2/mods-enabled/event.load").with_ensure('link') }
+ it { is_expected.to contain_file("/etc/apache2/mods-enabled/event.load").with_ensure('link') }
end
end
context "on a RedHat OS" do
@@ -87,13 +87,13 @@
}
end
- it { should contain_class("apache::params") }
- it { should_not contain_apache__mod('worker') }
- it { should_not contain_apache__mod('prefork') }
+ it { is_expected.to contain_class("apache::params") }
+ it { is_expected.not_to contain_apache__mod('worker') }
+ it { is_expected.not_to contain_apache__mod('prefork') }
- it { should contain_file("/etc/httpd/conf.d/event.conf").with_ensure('file') }
+ it { is_expected.to contain_file("/etc/httpd/conf.d/event.conf").with_ensure('file') }
- it { should contain_file("/etc/httpd/conf.d/event.load").with({
+ it { is_expected.to contain_file("/etc/httpd/conf.d/event.load").with({
'ensure' => 'file',
'content' => "LoadModule mpm_event_module modules/mod_mpm_event.so\n",
})
diff --git a/spec/classes/mod/fastcgi_spec.rb b/spec/classes/mod/fastcgi_spec.rb
index 98ad2e870..126c5cc3e 100644
--- a/spec/classes/mod/fastcgi_spec.rb
+++ b/spec/classes/mod/fastcgi_spec.rb
@@ -17,10 +17,10 @@
:path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
}
end
- it { should contain_class("apache::params") }
- it { should contain_apache__mod('fastcgi') }
- it { should contain_package("libapache2-mod-fastcgi") }
- it { should contain_file('fastcgi.conf') }
+ it { is_expected.to contain_class("apache::params") }
+ it { is_expected.to contain_apache__mod('fastcgi') }
+ it { is_expected.to contain_package("libapache2-mod-fastcgi") }
+ it { is_expected.to contain_file('fastcgi.conf') }
end
context "on a RedHat OS" do
@@ -35,9 +35,9 @@
:path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
}
end
- it { should contain_class("apache::params") }
- it { should contain_apache__mod('fastcgi') }
- it { should contain_package("mod_fastcgi") }
- it { should_not contain_file('fastcgi.conf') }
+ it { is_expected.to contain_class("apache::params") }
+ it { is_expected.to contain_apache__mod('fastcgi') }
+ it { is_expected.to contain_package("mod_fastcgi") }
+ it { is_expected.not_to contain_file('fastcgi.conf') }
end
end
diff --git a/spec/classes/mod/fcgid_spec.rb b/spec/classes/mod/fcgid_spec.rb
index 16719415d..ab47a5a8e 100644
--- a/spec/classes/mod/fcgid_spec.rb
+++ b/spec/classes/mod/fcgid_spec.rb
@@ -18,9 +18,9 @@
:path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
}
end
- it { should contain_class("apache::params") }
- it { should contain_apache__mod('fcgid') }
- it { should contain_package("libapache2-mod-fcgid") }
+ it { is_expected.to contain_class("apache::params") }
+ it { is_expected.to contain_apache__mod('fcgid') }
+ it { is_expected.to contain_package("libapache2-mod-fcgid") }
end
context "on a RedHat OS" do
@@ -37,9 +37,9 @@
end
describe 'without parameters' do
- it { should contain_class("apache::params") }
- it { should contain_apache__mod('fcgid') }
- it { should contain_package("mod_fcgid") }
+ it { is_expected.to contain_class("apache::params") }
+ it { is_expected.to contain_apache__mod('fcgid') }
+ it { is_expected.to contain_package("mod_fcgid") }
end
describe 'with parameters' do
@@ -54,14 +54,14 @@
it 'should contain the correct config' do
content = subject.resource('file', 'fcgid.conf').send(:parameters)[:content]
- content.split("\n").reject { |c| c =~ /(^#|^$)/ }.should == [
+ expect(content.split("\n").reject { |c| c =~ /(^#|^$)/ }).to eq([
'',
' AddHandler fcgid-script .fcgi',
' FcgidIPCDir /var/run/fcgidsock',
' FcgidMinProcessesPerClass 0',
' SharememPath /var/run/fcgid_shm',
'',
- ]
+ ])
end
end
end
@@ -79,8 +79,8 @@
}
end
- it { should contain_class("apache::params") }
- it { should contain_apache__mod('fcgid') }
- it { should contain_package("www/mod_fcgid") }
+ it { is_expected.to contain_class("apache::params") }
+ it { is_expected.to contain_apache__mod('fcgid') }
+ it { is_expected.to contain_package("www/mod_fcgid") }
end
end
diff --git a/spec/classes/mod/info_spec.rb b/spec/classes/mod/info_spec.rb
index ed078c519..3415dec67 100644
--- a/spec/classes/mod/info_spec.rb
+++ b/spec/classes/mod/info_spec.rb
@@ -2,10 +2,10 @@
# This function is called inside the OS specific contexts
def general_info_specs
- it { should contain_apache__mod("info") }
+ it { is_expected.to contain_apache__mod("info") }
it do
- should contain_file("info.conf").with_content(
+ is_expected.to contain_file("info.conf").with_content(
"\n"\
" SetHandler server-info\n"\
" Order deny,allow\n"\
@@ -38,11 +38,11 @@ def general_info_specs
# Load the more generic tests for this context
general_info_specs()
- it { should contain_file("info.conf").with({
+ it { is_expected.to contain_file("info.conf").with({
:ensure => 'file',
:path => '/etc/apache2/mods-available/info.conf',
} ) }
- it { should contain_file("info.conf symlink").with({
+ it { is_expected.to contain_file("info.conf symlink").with({
:ensure => 'link',
:path => '/etc/apache2/mods-enabled/info.conf',
} ) }
@@ -64,7 +64,7 @@ def general_info_specs
# Load the more generic tests for this context
general_info_specs()
- it { should contain_file("info.conf").with_path("/etc/httpd/conf.d/info.conf") }
+ it { is_expected.to contain_file("info.conf").with_path("/etc/httpd/conf.d/info.conf") }
end
context "On a FreeBSD OS with default params" do
@@ -83,7 +83,7 @@ def general_info_specs
# Load the more generic tests for this context
general_info_specs()
- it { should contain_file("info.conf").with({
+ it { is_expected.to contain_file("info.conf").with({
:ensure => 'file',
:path => '/usr/local/etc/apache22/Modules/info.conf',
} ) }
@@ -106,7 +106,7 @@ def general_info_specs
{ :allow_from => ['10.10.10.10','11.11.11.11'] }
end
it do
- should contain_file("info.conf").with_content(
+ is_expected.to contain_file("info.conf").with_content(
"\n"\
" SetHandler server-info\n"\
" Order deny,allow\n"\
diff --git a/spec/classes/mod/itk_spec.rb b/spec/classes/mod/itk_spec.rb
index d9fe2e3d1..b5d50a18a 100644
--- a/spec/classes/mod/itk_spec.rb
+++ b/spec/classes/mod/itk_spec.rb
@@ -17,10 +17,10 @@
:path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
}
end
- it { should contain_class("apache::params") }
- it { should_not contain_apache__mod('itk') }
- it { should contain_file("/etc/apache2/mods-available/itk.conf").with_ensure('file') }
- it { should contain_file("/etc/apache2/mods-enabled/itk.conf").with_ensure('link') }
+ it { is_expected.to contain_class("apache::params") }
+ it { is_expected.not_to contain_apache__mod('itk') }
+ it { is_expected.to contain_file("/etc/apache2/mods-available/itk.conf").with_ensure('file') }
+ it { is_expected.to contain_file("/etc/apache2/mods-enabled/itk.conf").with_ensure('link') }
context "with Apache version < 2.4" do
let :params do
@@ -29,10 +29,10 @@
}
end
- it { should_not contain_file("/etc/apache2/mods-available/itk.load") }
- it { should_not contain_file("/etc/apache2/mods-enabled/itk.load") }
+ it { is_expected.not_to contain_file("/etc/apache2/mods-available/itk.load") }
+ it { is_expected.not_to contain_file("/etc/apache2/mods-enabled/itk.load") }
- it { should contain_package("apache2-mpm-itk") }
+ it { is_expected.to contain_package("apache2-mpm-itk") }
end
context "with Apache version >= 2.4" do
@@ -42,12 +42,12 @@
}
end
- it { should contain_file("/etc/apache2/mods-available/itk.load").with({
+ it { is_expected.to contain_file("/etc/apache2/mods-available/itk.load").with({
'ensure' => 'file',
'content' => "LoadModule mpm_itk_module /usr/lib/apache2/modules/mod_mpm_itk.so\n"
})
}
- it { should contain_file("/etc/apache2/mods-enabled/itk.load").with_ensure('link') }
+ it { is_expected.to contain_file("/etc/apache2/mods-enabled/itk.load").with_ensure('link') }
end
end
context "on a FreeBSD OS" do
@@ -62,8 +62,8 @@
:path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
}
end
- it { should contain_class("apache::params") }
- it { should_not contain_apache__mod('itk') }
- it { should contain_file("/usr/local/etc/apache22/Modules/itk.conf").with_ensure('file') }
+ it { is_expected.to contain_class("apache::params") }
+ it { is_expected.not_to contain_apache__mod('itk') }
+ it { is_expected.to contain_file("/usr/local/etc/apache22/Modules/itk.conf").with_ensure('file') }
end
end
diff --git a/spec/classes/mod/mime_magic_spec.rb b/spec/classes/mod/mime_magic_spec.rb
index e9984ecba..5e78230e2 100644
--- a/spec/classes/mod/mime_magic_spec.rb
+++ b/spec/classes/mod/mime_magic_spec.rb
@@ -2,7 +2,7 @@
# This function is called inside the OS specific contexts
def general_mime_magic_specs
- it { should contain_apache__mod("mime_magic") }
+ it { is_expected.to contain_apache__mod("mime_magic") }
end
describe 'apache::mod::mime_magic', :type => :class do
@@ -27,16 +27,16 @@ def general_mime_magic_specs
general_mime_magic_specs()
it do
- should contain_file("mime_magic.conf").with_content(
+ is_expected.to contain_file("mime_magic.conf").with_content(
"MIMEMagicFile \"/etc/apache2/magic\"\n"
)
end
- it { should contain_file("mime_magic.conf").with({
+ it { is_expected.to contain_file("mime_magic.conf").with({
:ensure => 'file',
:path => '/etc/apache2/mods-available/mime_magic.conf',
} ) }
- it { should contain_file("mime_magic.conf symlink").with({
+ it { is_expected.to contain_file("mime_magic.conf symlink").with({
:ensure => 'link',
:path => '/etc/apache2/mods-enabled/mime_magic.conf',
} ) }
@@ -47,7 +47,7 @@ def general_mime_magic_specs
end
it do
- should contain_file("mime_magic.conf").with_content(
+ is_expected.to contain_file("mime_magic.conf").with_content(
"MIMEMagicFile \"/tmp/Debian_magic\"\n"
)
end
@@ -71,12 +71,12 @@ def general_mime_magic_specs
general_mime_magic_specs()
it do
- should contain_file("mime_magic.conf").with_content(
+ is_expected.to contain_file("mime_magic.conf").with_content(
"MIMEMagicFile \"/etc/httpd/conf/magic\"\n"
)
end
- it { should contain_file("mime_magic.conf").with_path("/etc/httpd/conf.d/mime_magic.conf") }
+ it { is_expected.to contain_file("mime_magic.conf").with_path("/etc/httpd/conf.d/mime_magic.conf") }
end
@@ -99,7 +99,7 @@ def general_mime_magic_specs
end
it do
- should contain_file("mime_magic.conf").with_content(
+ is_expected.to contain_file("mime_magic.conf").with_content(
"MIMEMagicFile \"/tmp/magic\"\n"
)
end
diff --git a/spec/classes/mod/mime_spec.rb b/spec/classes/mod/mime_spec.rb
index 2b6154fb8..32edbc4b0 100644
--- a/spec/classes/mod/mime_spec.rb
+++ b/spec/classes/mod/mime_spec.rb
@@ -2,7 +2,7 @@
# This function is called inside the OS specific conte, :compilexts
def general_mime_specs
- it { should contain_apache__mod("mime") }
+ it { is_expected.to contain_apache__mod("mime") }
end
describe 'apache::mod::mime', :type => :class do
@@ -26,7 +26,7 @@ def general_mime_specs
general_mime_specs()
- it { should contain_file("mime.conf").with_path('/etc/apache2/mods-available/mime.conf') }
+ it { is_expected.to contain_file("mime.conf").with_path('/etc/apache2/mods-available/mime.conf') }
end
@@ -45,7 +45,7 @@ def general_mime_specs
general_mime_specs()
- it { should contain_file("mime.conf").with_path("/etc/httpd/conf.d/mime.conf") }
+ it { is_expected.to contain_file("mime.conf").with_path("/etc/httpd/conf.d/mime.conf") }
end
diff --git a/spec/classes/mod/pagespeed_spec.rb b/spec/classes/mod/pagespeed_spec.rb
index 9439f719e..c4abd3e10 100644
--- a/spec/classes/mod/pagespeed_spec.rb
+++ b/spec/classes/mod/pagespeed_spec.rb
@@ -17,10 +17,10 @@
:path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
}
end
- it { should contain_class("apache::params") }
- it { should contain_apache__mod('pagespeed') }
- it { should contain_package("mod-pagespeed-stable") }
- it { should contain_file('pagespeed.conf') }
+ it { is_expected.to contain_class("apache::params") }
+ it { is_expected.to contain_apache__mod('pagespeed') }
+ it { is_expected.to contain_package("mod-pagespeed-stable") }
+ it { is_expected.to contain_file('pagespeed.conf') }
end
context "on a RedHat OS" do
@@ -35,9 +35,9 @@
:path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
}
end
- it { should contain_class("apache::params") }
- it { should contain_apache__mod('pagespeed') }
- it { should contain_package("mod-pagespeed-stable") }
- it { should contain_file('pagespeed.conf') }
+ it { is_expected.to contain_class("apache::params") }
+ it { is_expected.to contain_apache__mod('pagespeed') }
+ it { is_expected.to contain_package("mod-pagespeed-stable") }
+ it { is_expected.to contain_file('pagespeed.conf') }
end
end
diff --git a/spec/classes/mod/passenger_spec.rb b/spec/classes/mod/passenger_spec.rb
index 3bf7d2995..7fc1e3a63 100644
--- a/spec/classes/mod/passenger_spec.rb
+++ b/spec/classes/mod/passenger_spec.rb
@@ -17,105 +17,105 @@
:path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
}
end
- it { should contain_class("apache::params") }
- it { should contain_apache__mod('passenger') }
- it { should contain_package("libapache2-mod-passenger") }
- it { should contain_file('passenger.load').with({
+ it { is_expected.to contain_class("apache::params") }
+ it { is_expected.to contain_apache__mod('passenger') }
+ it { is_expected.to contain_package("libapache2-mod-passenger") }
+ it { is_expected.to contain_file('passenger.load').with({
'path' => '/etc/apache2/mods-available/passenger.load',
}) }
- it { should contain_file('passenger.conf').with({
+ it { is_expected.to contain_file('passenger.conf').with({
'path' => '/etc/apache2/mods-available/passenger.conf',
}) }
- it { should contain_file('passenger_package.conf').with_ensure('absent') }
+ it { is_expected.to contain_file('passenger_package.conf').with_ensure('absent') }
describe "with passenger_root => '/usr/lib/example'" do
let :params do
{ :passenger_root => '/usr/lib/example' }
end
- it { should contain_file('passenger.conf').with_content(%r{PassengerRoot "/usr/lib/example"}) }
+ it { is_expected.to contain_file('passenger.conf').with_content(%r{PassengerRoot "/usr/lib/example"}) }
end
describe "with passenger_ruby => /usr/lib/example/ruby" do
let :params do
{ :passenger_ruby => '/usr/lib/example/ruby' }
end
- it { should contain_file('passenger.conf').with_content(%r{PassengerRuby "/usr/lib/example/ruby"}) }
+ it { is_expected.to contain_file('passenger.conf').with_content(%r{PassengerRuby "/usr/lib/example/ruby"}) }
end
describe "with passenger_default_ruby => /usr/lib/example/ruby1.9.3" do
let :params do
{ :passenger_ruby => '/usr/lib/example/ruby1.9.3' }
end
- it { should contain_file('passenger.conf').with_content(%r{PassengerRuby "/usr/lib/example/ruby1.9.3"}) }
+ it { is_expected.to contain_file('passenger.conf').with_content(%r{PassengerRuby "/usr/lib/example/ruby1.9.3"}) }
end
describe "with passenger_high_performance => on" do
let :params do
{ :passenger_high_performance => 'on' }
end
- it { should contain_file('passenger.conf').with_content(/^ PassengerHighPerformance on$/) }
+ it { is_expected.to contain_file('passenger.conf').with_content(/^ PassengerHighPerformance on$/) }
end
describe "with passenger_pool_idle_time => 1200" do
let :params do
{ :passenger_pool_idle_time => 1200 }
end
- it { should contain_file('passenger.conf').with_content(/^ PassengerPoolIdleTime 1200$/) }
+ it { is_expected.to contain_file('passenger.conf').with_content(/^ PassengerPoolIdleTime 1200$/) }
end
describe "with passenger_max_requests => 20" do
let :params do
{ :passenger_max_requests => 20 }
end
- it { should contain_file('passenger.conf').with_content(/^ PassengerMaxRequests 20$/) }
+ it { is_expected.to contain_file('passenger.conf').with_content(/^ PassengerMaxRequests 20$/) }
end
describe "with passenger_stat_throttle_rate => 10" do
let :params do
{ :passenger_stat_throttle_rate => 10 }
end
- it { should contain_file('passenger.conf').with_content(/^ PassengerStatThrottleRate 10$/) }
+ it { is_expected.to contain_file('passenger.conf').with_content(/^ PassengerStatThrottleRate 10$/) }
end
describe "with passenger_max_pool_size => 16" do
let :params do
{ :passenger_max_pool_size => 16 }
end
- it { should contain_file('passenger.conf').with_content(/^ PassengerMaxPoolSize 16$/) }
+ it { is_expected.to contain_file('passenger.conf').with_content(/^ PassengerMaxPoolSize 16$/) }
end
describe "with rack_autodetect => on" do
let :params do
{ :rack_autodetect => 'on' }
end
- it { should contain_file('passenger.conf').with_content(/^ RackAutoDetect on$/) }
+ it { is_expected.to contain_file('passenger.conf').with_content(/^ RackAutoDetect on$/) }
end
describe "with rails_autodetect => on" do
let :params do
{ :rails_autodetect => 'on' }
end
- it { should contain_file('passenger.conf').with_content(/^ RailsAutoDetect on$/) }
+ it { is_expected.to contain_file('passenger.conf').with_content(/^ RailsAutoDetect on$/) }
end
describe "with passenger_use_global_queue => on" do
let :params do
{ :passenger_use_global_queue => 'on' }
end
- it { should contain_file('passenger.conf').with_content(/^ PassengerUseGlobalQueue on$/) }
+ it { is_expected.to contain_file('passenger.conf').with_content(/^ PassengerUseGlobalQueue on$/) }
end
describe "with mod_path => '/usr/lib/foo/mod_foo.so'" do
let :params do
{ :mod_path => '/usr/lib/foo/mod_foo.so' }
end
- it { should contain_file('passenger.load').with_content(/^LoadModule passenger_module \/usr\/lib\/foo\/mod_foo\.so$/) }
+ it { is_expected.to contain_file('passenger.load').with_content(/^LoadModule passenger_module \/usr\/lib\/foo\/mod_foo\.so$/) }
end
describe "with mod_lib_path => '/usr/lib/foo'" do
let :params do
{ :mod_lib_path => '/usr/lib/foo' }
end
- it { should contain_file('passenger.load').with_content(/^LoadModule passenger_module \/usr\/lib\/foo\/mod_passenger\.so$/) }
+ it { is_expected.to contain_file('passenger.load').with_content(/^LoadModule passenger_module \/usr\/lib\/foo\/mod_passenger\.so$/) }
end
describe "with mod_lib => 'mod_foo.so'" do
let :params do
{ :mod_lib => 'mod_foo.so' }
end
- it { should contain_file('passenger.load').with_content(/^LoadModule passenger_module \/usr\/lib\/apache2\/modules\/mod_foo\.so$/) }
+ it { is_expected.to contain_file('passenger.load').with_content(/^LoadModule passenger_module \/usr\/lib\/apache2\/modules\/mod_foo\.so$/) }
end
describe "with mod_id => 'mod_foo'" do
let :params do
{ :mod_id => 'mod_foo' }
end
- it { should contain_file('passenger.load').with_content(/^LoadModule mod_foo \/usr\/lib\/apache2\/modules\/mod_passenger\.so$/) }
+ it { is_expected.to contain_file('passenger.load').with_content(/^LoadModule mod_foo \/usr\/lib\/apache2\/modules\/mod_passenger\.so$/) }
end
context "with Ubuntu 12.04 defaults" do
@@ -131,9 +131,9 @@
}
end
- it { should contain_file('passenger.conf').with_content(%r{PassengerRoot "/usr"}) }
- it { should contain_file('passenger.conf').with_content(%r{PassengerRuby "/usr/bin/ruby"}) }
- it { should contain_file('passenger.conf').without_content(/PassengerDefaultRuby/) }
+ it { is_expected.to contain_file('passenger.conf').with_content(%r{PassengerRoot "/usr"}) }
+ it { is_expected.to contain_file('passenger.conf').with_content(%r{PassengerRuby "/usr/bin/ruby"}) }
+ it { is_expected.to contain_file('passenger.conf').without_content(/PassengerDefaultRuby/) }
end
context "with Ubuntu 14.04 defaults" do
@@ -149,9 +149,9 @@
}
end
- it { should contain_file('passenger.conf').with_content(%r{PassengerRoot "/usr/lib/ruby/vendor_ruby/phusion_passenger/locations.ini"}) }
- it { should contain_file('passenger.conf').without_content(/PassengerRuby/) }
- it { should contain_file('passenger.conf').with_content(%r{PassengerDefaultRuby "/usr/bin/ruby"}) }
+ it { is_expected.to contain_file('passenger.conf').with_content(%r{PassengerRoot "/usr/lib/ruby/vendor_ruby/phusion_passenger/locations.ini"}) }
+ it { is_expected.to contain_file('passenger.conf').without_content(/PassengerRuby/) }
+ it { is_expected.to contain_file('passenger.conf').with_content(%r{PassengerDefaultRuby "/usr/bin/ruby"}) }
end
context "with Debian 7 defaults" do
@@ -167,9 +167,9 @@
}
end
- it { should contain_file('passenger.conf').with_content(%r{PassengerRoot "/usr"}) }
- it { should contain_file('passenger.conf').with_content(%r{PassengerRuby "/usr/bin/ruby"}) }
- it { should contain_file('passenger.conf').without_content(/PassengerDefaultRuby/) }
+ it { is_expected.to contain_file('passenger.conf').with_content(%r{PassengerRoot "/usr"}) }
+ it { is_expected.to contain_file('passenger.conf').with_content(%r{PassengerRuby "/usr/bin/ruby"}) }
+ it { is_expected.to contain_file('passenger.conf').without_content(/PassengerDefaultRuby/) }
end
end
@@ -185,30 +185,30 @@
:path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
}
end
- it { should contain_class("apache::params") }
- it { should contain_apache__mod('passenger') }
- it { should contain_package("mod_passenger") }
- it { should contain_file('passenger_package.conf').with({
+ it { is_expected.to contain_class("apache::params") }
+ it { is_expected.to contain_apache__mod('passenger') }
+ it { is_expected.to contain_package("mod_passenger") }
+ it { is_expected.to contain_file('passenger_package.conf').with({
'path' => '/etc/httpd/conf.d/passenger.conf',
}) }
- it { should contain_file('passenger_package.conf').without_content }
- it { should contain_file('passenger_package.conf').without_source }
- it { should contain_file('passenger.load').with({
+ it { is_expected.to contain_file('passenger_package.conf').without_content }
+ it { is_expected.to contain_file('passenger_package.conf').without_source }
+ it { is_expected.to contain_file('passenger.load').with({
'path' => '/etc/httpd/conf.d/passenger.load',
}) }
- it { should contain_file('passenger.conf').without_content(/PassengerRoot/) }
- it { should contain_file('passenger.conf').without_content(/PassengerRuby/) }
+ it { is_expected.to contain_file('passenger.conf').without_content(/PassengerRoot/) }
+ it { is_expected.to contain_file('passenger.conf').without_content(/PassengerRuby/) }
describe "with passenger_root => '/usr/lib/example'" do
let :params do
{ :passenger_root => '/usr/lib/example' }
end
- it { should contain_file('passenger.conf').with_content(/^ PassengerRoot "\/usr\/lib\/example"$/) }
+ it { is_expected.to contain_file('passenger.conf').with_content(/^ PassengerRoot "\/usr\/lib\/example"$/) }
end
describe "with passenger_ruby => /usr/lib/example/ruby" do
let :params do
{ :passenger_ruby => '/usr/lib/example/ruby' }
end
- it { should contain_file('passenger.conf').with_content(/^ PassengerRuby "\/usr\/lib\/example\/ruby"$/) }
+ it { is_expected.to contain_file('passenger.conf').with_content(/^ PassengerRuby "\/usr\/lib\/example\/ruby"$/) }
end
end
context "on a FreeBSD OS" do
@@ -223,8 +223,8 @@
:path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
}
end
- it { should contain_class("apache::params") }
- it { should contain_apache__mod('passenger') }
- it { should contain_package("www/rubygem-passenger") }
+ it { is_expected.to contain_class("apache::params") }
+ it { is_expected.to contain_apache__mod('passenger') }
+ it { is_expected.to contain_package("www/rubygem-passenger") }
end
end
diff --git a/spec/classes/mod/perl_spec.rb b/spec/classes/mod/perl_spec.rb
index f674318e2..2c14c31f0 100644
--- a/spec/classes/mod/perl_spec.rb
+++ b/spec/classes/mod/perl_spec.rb
@@ -17,9 +17,9 @@
:path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
}
end
- it { should contain_class("apache::params") }
- it { should contain_apache__mod('perl') }
- it { should contain_package("libapache2-mod-perl2") }
+ it { is_expected.to contain_class("apache::params") }
+ it { is_expected.to contain_apache__mod('perl') }
+ it { is_expected.to contain_package("libapache2-mod-perl2") }
end
context "on a RedHat OS" do
let :facts do
@@ -33,9 +33,9 @@
:path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
}
end
- it { should contain_class("apache::params") }
- it { should contain_apache__mod('perl') }
- it { should contain_package("mod_perl") }
+ it { is_expected.to contain_class("apache::params") }
+ it { is_expected.to contain_apache__mod('perl') }
+ it { is_expected.to contain_package("mod_perl") }
end
context "on a FreeBSD OS" do
let :facts do
@@ -49,8 +49,8 @@
:path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
}
end
- it { should contain_class("apache::params") }
- it { should contain_apache__mod('perl') }
- it { should contain_package("www/mod_perl2") }
+ it { is_expected.to contain_class("apache::params") }
+ it { is_expected.to contain_apache__mod('perl') }
+ it { is_expected.to contain_package("www/mod_perl2") }
end
end
diff --git a/spec/classes/mod/peruser_spec.rb b/spec/classes/mod/peruser_spec.rb
index e1ee004e9..c0dfc96f5 100644
--- a/spec/classes/mod/peruser_spec.rb
+++ b/spec/classes/mod/peruser_spec.rb
@@ -16,8 +16,8 @@
:path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
}
end
- it { should contain_class("apache::params") }
- it { should_not contain_apache__mod('peruser') }
- it { should contain_file("/usr/local/etc/apache22/Modules/peruser.conf").with_ensure('file') }
+ it { is_expected.to contain_class("apache::params") }
+ it { is_expected.not_to contain_apache__mod('peruser') }
+ it { is_expected.to contain_file("/usr/local/etc/apache22/Modules/peruser.conf").with_ensure('file') }
end
end
diff --git a/spec/classes/mod/php_spec.rb b/spec/classes/mod/php_spec.rb
index cba128a82..c1fd14b01 100644
--- a/spec/classes/mod/php_spec.rb
+++ b/spec/classes/mod/php_spec.rb
@@ -18,10 +18,10 @@
let :pre_condition do
'class { "apache": mpm_module => prefork, }'
end
- it { should contain_class("apache::params") }
- it { should contain_apache__mod('php5') }
- it { should contain_package("libapache2-mod-php5") }
- it { should contain_file("php5.load").with(
+ it { is_expected.to contain_class("apache::params") }
+ it { is_expected.to contain_apache__mod('php5') }
+ it { is_expected.to contain_package("libapache2-mod-php5") }
+ it { is_expected.to contain_file("php5.load").with(
:content => "LoadModule php5_module /usr/lib/apache2/modules/libphp5.so\n"
) }
end
@@ -50,10 +50,10 @@
let :pre_condition do
'class { "apache": }'
end
- it { should contain_class("apache::params") }
- it { should contain_apache__mod('php5') }
- it { should contain_package("php") }
- it { should contain_file("php5.load").with(
+ it { is_expected.to contain_class("apache::params") }
+ it { is_expected.to contain_apache__mod('php5') }
+ it { is_expected.to contain_package("php") }
+ it { is_expected.to contain_file("php5.load").with(
:content => "LoadModule php5_module modules/libphp5.so\n"
) }
end
@@ -63,7 +63,7 @@
let :params do
{ :package_name => 'php54'}
end
- it { should contain_package("php54") }
+ it { is_expected.to contain_package("php54") }
end
context "with alternative path" do let :pre_condition do
'class { "apache": }'
@@ -71,7 +71,7 @@
let :params do
{ :path => 'alternative-path'}
end
- it { should contain_file("php5.load").with(
+ it { is_expected.to contain_file("php5.load").with(
:content => "LoadModule php5_module alternative-path\n"
) }
end
@@ -81,7 +81,7 @@
let :params do
{ :extensions => ['.php','.php5']}
end
- it { should contain_file("php5.conf").with_content(/AddHandler php5-script .php .php5\n/) }
+ it { is_expected.to contain_file("php5.conf").with_content(/AddHandler php5-script .php .php5\n/) }
end
context "with specific version" do
let :pre_condition do
@@ -90,7 +90,7 @@
let :params do
{ :package_ensure => '5.3.13'}
end
- it { should contain_package("php").with(
+ it { is_expected.to contain_package("php").with(
:ensure => '5.3.13'
) }
end
@@ -98,10 +98,10 @@
let :pre_condition do
'class { "apache": mpm_module => prefork, }'
end
- it { should contain_class("apache::params") }
- it { should contain_apache__mod('php5') }
- it { should contain_package("php") }
- it { should contain_file("php5.load").with(
+ it { is_expected.to contain_class("apache::params") }
+ it { is_expected.to contain_apache__mod('php5') }
+ it { is_expected.to contain_package("php") }
+ it { is_expected.to contain_file("php5.load").with(
:content => "LoadModule php5_module modules/libphp5.so\n"
) }
end
@@ -122,10 +122,10 @@
let :pre_condition do
'class { "apache": mpm_module => prefork, }'
end
- it { should contain_class('apache::params') }
- it { should contain_apache__mod('php5') }
- it { should contain_package("lang/php5") }
- it { should contain_file('php5.load') }
+ it { is_expected.to contain_class('apache::params') }
+ it { is_expected.to contain_apache__mod('php5') }
+ it { is_expected.to contain_package("lang/php5") }
+ it { is_expected.to contain_file('php5.load') }
end
# FIXME: not sure about the following context
context 'with mpm_module => worker' do
@@ -133,7 +133,7 @@
'class { "apache": mpm_module => worker, }'
end
it 'should raise an error' do
- expect { subject.should contain_apache__mod('php5') }.to raise_error Puppet::Error, /mpm_module => 'prefork'/
+ expect { expect(subject).to contain_apache__mod('php5') }.to raise_error Puppet::Error, /mpm_module => 'prefork'/
end
end
end
diff --git a/spec/classes/mod/prefork_spec.rb b/spec/classes/mod/prefork_spec.rb
index 847aecf9c..34bca08dc 100644
--- a/spec/classes/mod/prefork_spec.rb
+++ b/spec/classes/mod/prefork_spec.rb
@@ -17,10 +17,10 @@
:path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
}
end
- it { should contain_class("apache::params") }
- it { should_not contain_apache__mod('prefork') }
- it { should contain_file("/etc/apache2/mods-available/prefork.conf").with_ensure('file') }
- it { should contain_file("/etc/apache2/mods-enabled/prefork.conf").with_ensure('link') }
+ it { is_expected.to contain_class("apache::params") }
+ it { is_expected.not_to contain_apache__mod('prefork') }
+ it { is_expected.to contain_file("/etc/apache2/mods-available/prefork.conf").with_ensure('file') }
+ it { is_expected.to contain_file("/etc/apache2/mods-enabled/prefork.conf").with_ensure('link') }
context "with Apache version < 2.4" do
let :params do
@@ -29,10 +29,10 @@
}
end
- it { should_not contain_file("/etc/apache2/mods-available/prefork.load") }
- it { should_not contain_file("/etc/apache2/mods-enabled/prefork.load") }
+ it { is_expected.not_to contain_file("/etc/apache2/mods-available/prefork.load") }
+ it { is_expected.not_to contain_file("/etc/apache2/mods-enabled/prefork.load") }
- it { should contain_package("apache2-mpm-prefork") }
+ it { is_expected.to contain_package("apache2-mpm-prefork") }
end
context "with Apache version >= 2.4" do
@@ -42,12 +42,12 @@
}
end
- it { should contain_file("/etc/apache2/mods-available/prefork.load").with({
+ it { is_expected.to contain_file("/etc/apache2/mods-available/prefork.load").with({
'ensure' => 'file',
'content' => "LoadModule mpm_prefork_module /usr/lib/apache2/modules/mod_mpm_prefork.so\n"
})
}
- it { should contain_file("/etc/apache2/mods-enabled/prefork.load").with_ensure('link') }
+ it { is_expected.to contain_file("/etc/apache2/mods-enabled/prefork.load").with_ensure('link') }
end
end
context "on a RedHat OS" do
@@ -62,9 +62,9 @@
:path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
}
end
- it { should contain_class("apache::params") }
- it { should_not contain_apache__mod('prefork') }
- it { should contain_file("/etc/httpd/conf.d/prefork.conf").with_ensure('file') }
+ it { is_expected.to contain_class("apache::params") }
+ it { is_expected.not_to contain_apache__mod('prefork') }
+ it { is_expected.to contain_file("/etc/httpd/conf.d/prefork.conf").with_ensure('file') }
context "with Apache version < 2.4" do
let :params do
@@ -73,7 +73,7 @@
}
end
- it { should contain_file_line("/etc/sysconfig/httpd prefork enable").with({
+ it { is_expected.to contain_file_line("/etc/sysconfig/httpd prefork enable").with({
'require' => 'Package[httpd]',
})
}
@@ -86,9 +86,9 @@
}
end
- it { should_not contain_apache__mod('event') }
+ it { is_expected.not_to contain_apache__mod('event') }
- it { should contain_file("/etc/httpd/conf.d/prefork.load").with({
+ it { is_expected.to contain_file("/etc/httpd/conf.d/prefork.load").with({
'ensure' => 'file',
'content' => "LoadModule mpm_prefork_module modules/mod_mpm_prefork.so\n",
})
@@ -107,8 +107,8 @@
:path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
}
end
- it { should contain_class("apache::params") }
- it { should_not contain_apache__mod('prefork') }
- it { should contain_file("/usr/local/etc/apache22/Modules/prefork.conf").with_ensure('file') }
+ it { is_expected.to contain_class("apache::params") }
+ it { is_expected.not_to contain_apache__mod('prefork') }
+ it { is_expected.to contain_file("/usr/local/etc/apache22/Modules/prefork.conf").with_ensure('file') }
end
end
diff --git a/spec/classes/mod/proxy_html_spec.rb b/spec/classes/mod/proxy_html_spec.rb
index 77e1ab15d..81a2bb537 100644
--- a/spec/classes/mod/proxy_html_spec.rb
+++ b/spec/classes/mod/proxy_html_spec.rb
@@ -10,9 +10,9 @@
end
context "on a Debian OS" do
shared_examples "debian" do |loadfiles|
- it { should contain_class("apache::params") }
- it { should contain_apache__mod('proxy_html').with(:loadfiles => loadfiles) }
- it { should contain_package("libapache2-mod-proxy-html") }
+ it { is_expected.to contain_class("apache::params") }
+ it { is_expected.to contain_apache__mod('proxy_html').with(:loadfiles => loadfiles) }
+ it { is_expected.to contain_package("libapache2-mod-proxy-html") }
end
let :facts do
{
@@ -62,9 +62,9 @@
:path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
}
end
- it { should contain_class("apache::params") }
- it { should contain_apache__mod('proxy_html').with(:loadfiles => nil) }
- it { should contain_package("mod_proxy_html") }
+ it { is_expected.to contain_class("apache::params") }
+ it { is_expected.to contain_apache__mod('proxy_html').with(:loadfiles => nil) }
+ it { is_expected.to contain_package("mod_proxy_html") }
end
context "on a FreeBSD OS", :compile do
let :facts do
@@ -78,8 +78,8 @@
:path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
}
end
- it { should contain_class("apache::params") }
- it { should contain_apache__mod('proxy_html').with(:loadfiles => nil) }
- it { should contain_package("www/mod_proxy_html") }
+ it { is_expected.to contain_class("apache::params") }
+ it { is_expected.to contain_apache__mod('proxy_html').with(:loadfiles => nil) }
+ it { is_expected.to contain_package("www/mod_proxy_html") }
end
end
diff --git a/spec/classes/mod/python_spec.rb b/spec/classes/mod/python_spec.rb
index d2d1fca7b..17b62d43b 100644
--- a/spec/classes/mod/python_spec.rb
+++ b/spec/classes/mod/python_spec.rb
@@ -17,9 +17,9 @@
:path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
}
end
- it { should contain_class("apache::params") }
- it { should contain_apache__mod("python") }
- it { should contain_package("libapache2-mod-python") }
+ it { is_expected.to contain_class("apache::params") }
+ it { is_expected.to contain_apache__mod("python") }
+ it { is_expected.to contain_package("libapache2-mod-python") }
end
context "on a RedHat OS" do
let :facts do
@@ -33,9 +33,9 @@
:path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
}
end
- it { should contain_class("apache::params") }
- it { should contain_apache__mod("python") }
- it { should contain_package("mod_python") }
+ it { is_expected.to contain_class("apache::params") }
+ it { is_expected.to contain_apache__mod("python") }
+ it { is_expected.to contain_package("mod_python") }
end
context "on a FreeBSD OS" do
let :facts do
@@ -49,8 +49,8 @@
:path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
}
end
- it { should contain_class("apache::params") }
- it { should contain_apache__mod("python") }
- it { should contain_package("www/mod_python3") }
+ it { is_expected.to contain_class("apache::params") }
+ it { is_expected.to contain_apache__mod("python") }
+ it { is_expected.to contain_package("www/mod_python3") }
end
end
diff --git a/spec/classes/mod/rpaf_spec.rb b/spec/classes/mod/rpaf_spec.rb
index 949dd5702..ca3a59484 100644
--- a/spec/classes/mod/rpaf_spec.rb
+++ b/spec/classes/mod/rpaf_spec.rb
@@ -19,31 +19,31 @@
:path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
}
end
- it { should contain_class("apache::params") }
- it { should contain_apache__mod('rpaf') }
- it { should contain_package("libapache2-mod-rpaf") }
- it { should contain_file('rpaf.conf').with({
+ it { is_expected.to contain_class("apache::params") }
+ it { is_expected.to contain_apache__mod('rpaf') }
+ it { is_expected.to contain_package("libapache2-mod-rpaf") }
+ it { is_expected.to contain_file('rpaf.conf').with({
'path' => '/etc/apache2/mods-available/rpaf.conf',
}) }
- it { should contain_file('rpaf.conf').with_content(/^RPAFenable On$/) }
+ it { is_expected.to contain_file('rpaf.conf').with_content(/^RPAFenable On$/) }
describe "with sethostname => true" do
let :params do
{ :sethostname => 'true' }
end
- it { should contain_file('rpaf.conf').with_content(/^RPAFsethostname On$/) }
+ it { is_expected.to contain_file('rpaf.conf').with_content(/^RPAFsethostname On$/) }
end
describe "with proxy_ips => [ 10.42.17.8, 10.42.18.99 ]" do
let :params do
{ :proxy_ips => [ '10.42.17.8', '10.42.18.99' ] }
end
- it { should contain_file('rpaf.conf').with_content(/^RPAFproxy_ips 10.42.17.8 10.42.18.99$/) }
+ it { is_expected.to contain_file('rpaf.conf').with_content(/^RPAFproxy_ips 10.42.17.8 10.42.18.99$/) }
end
describe "with header => X-Real-IP" do
let :params do
{ :header => 'X-Real-IP' }
end
- it { should contain_file('rpaf.conf').with_content(/^RPAFheader X-Real-IP$/) }
+ it { is_expected.to contain_file('rpaf.conf').with_content(/^RPAFheader X-Real-IP$/) }
end
end
context "on a FreeBSD OS" do
@@ -58,31 +58,31 @@
:path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
}
end
- it { should contain_class("apache::params") }
- it { should contain_apache__mod('rpaf') }
- it { should contain_package("www/mod_rpaf2") }
- it { should contain_file('rpaf.conf').with({
+ it { is_expected.to contain_class("apache::params") }
+ it { is_expected.to contain_apache__mod('rpaf') }
+ it { is_expected.to contain_package("www/mod_rpaf2") }
+ it { is_expected.to contain_file('rpaf.conf').with({
'path' => '/usr/local/etc/apache22/Modules/rpaf.conf',
}) }
- it { should contain_file('rpaf.conf').with_content(/^RPAFenable On$/) }
+ it { is_expected.to contain_file('rpaf.conf').with_content(/^RPAFenable On$/) }
describe "with sethostname => true" do
let :params do
{ :sethostname => 'true' }
end
- it { should contain_file('rpaf.conf').with_content(/^RPAFsethostname On$/) }
+ it { is_expected.to contain_file('rpaf.conf').with_content(/^RPAFsethostname On$/) }
end
describe "with proxy_ips => [ 10.42.17.8, 10.42.18.99 ]" do
let :params do
{ :proxy_ips => [ '10.42.17.8', '10.42.18.99' ] }
end
- it { should contain_file('rpaf.conf').with_content(/^RPAFproxy_ips 10.42.17.8 10.42.18.99$/) }
+ it { is_expected.to contain_file('rpaf.conf').with_content(/^RPAFproxy_ips 10.42.17.8 10.42.18.99$/) }
end
describe "with header => X-Real-IP" do
let :params do
{ :header => 'X-Real-IP' }
end
- it { should contain_file('rpaf.conf').with_content(/^RPAFheader X-Real-IP$/) }
+ it { is_expected.to contain_file('rpaf.conf').with_content(/^RPAFheader X-Real-IP$/) }
end
end
end
diff --git a/spec/classes/mod/speling_spec.rb b/spec/classes/mod/speling_spec.rb
index e7e6e1d64..814e0d672 100644
--- a/spec/classes/mod/speling_spec.rb
+++ b/spec/classes/mod/speling_spec.rb
@@ -17,7 +17,7 @@
:path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
}
end
- it { should contain_apache__mod('speling') }
+ it { is_expected.to contain_apache__mod('speling') }
end
context "on a RedHat OS" do
@@ -32,6 +32,6 @@
:path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
}
end
- it { should contain_apache__mod('speling') }
+ it { is_expected.to contain_apache__mod('speling') }
end
end
diff --git a/spec/classes/mod/ssl_spec.rb b/spec/classes/mod/ssl_spec.rb
index 11e7964de..fb6ba4eb5 100644
--- a/spec/classes/mod/ssl_spec.rb
+++ b/spec/classes/mod/ssl_spec.rb
@@ -31,9 +31,9 @@
:path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
}
end
- it { should contain_class('apache::params') }
- it { should contain_apache__mod('ssl') }
- it { should contain_package('mod_ssl') }
+ it { is_expected.to contain_class('apache::params') }
+ it { is_expected.to contain_apache__mod('ssl') }
+ it { is_expected.to contain_package('mod_ssl') }
end
context 'on a Debian OS' do
@@ -49,9 +49,9 @@
:path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
}
end
- it { should contain_class('apache::params') }
- it { should contain_apache__mod('ssl') }
- it { should_not contain_package('libapache2-mod-ssl') }
+ it { is_expected.to contain_class('apache::params') }
+ it { is_expected.to contain_apache__mod('ssl') }
+ it { is_expected.not_to contain_package('libapache2-mod-ssl') }
end
context 'on a FreeBSD OS' do
@@ -66,7 +66,7 @@
:path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
}
end
- it { should contain_class('apache::params') }
- it { should contain_apache__mod('ssl') }
+ it { is_expected.to contain_class('apache::params') }
+ it { is_expected.to contain_apache__mod('ssl') }
end
end
diff --git a/spec/classes/mod/status_spec.rb b/spec/classes/mod/status_spec.rb
index 5023bc7bf..adb60861b 100644
--- a/spec/classes/mod/status_spec.rb
+++ b/spec/classes/mod/status_spec.rb
@@ -3,7 +3,7 @@
# Helper function for testing the contents of `status.conf`
def status_conf_spec(allow_from, extended_status)
it do
- should contain_file("status.conf").with_content(
+ is_expected.to contain_file("status.conf").with_content(
"\n"\
" SetHandler server-status\n"\
" Order deny,allow\n"\
@@ -39,16 +39,16 @@ def status_conf_spec(allow_from, extended_status)
}
end
- it { should contain_apache__mod("status") }
+ it { is_expected.to contain_apache__mod("status") }
status_conf_spec(["127.0.0.1", "::1"], "On")
- it { should contain_file("status.conf").with({
+ it { is_expected.to contain_file("status.conf").with({
:ensure => 'file',
:path => '/etc/apache2/mods-available/status.conf',
} ) }
- it { should contain_file("status.conf symlink").with({
+ it { is_expected.to contain_file("status.conf symlink").with({
:ensure => 'link',
:path => '/etc/apache2/mods-enabled/status.conf',
} ) }
@@ -68,11 +68,11 @@ def status_conf_spec(allow_from, extended_status)
}
end
- it { should contain_apache__mod("status") }
+ it { is_expected.to contain_apache__mod("status") }
status_conf_spec(["127.0.0.1", "::1"], "On")
- it { should contain_file("status.conf").with_path("/etc/httpd/conf.d/status.conf") }
+ it { is_expected.to contain_file("status.conf").with_path("/etc/httpd/conf.d/status.conf") }
end
@@ -118,7 +118,7 @@ def status_conf_spec(allow_from, extended_status)
end
it 'should expect to succeed array validation' do
expect {
- should contain_file("status.conf")
+ is_expected.to contain_file("status.conf")
}.not_to raise_error()
end
end
@@ -140,7 +140,7 @@ def status_conf_spec(allow_from, extended_status)
end
it 'should expect to fail array validation' do
expect {
- should contain_file("status.conf")
+ is_expected.to contain_file("status.conf")
}.to raise_error(Puppet::Error)
end
end
@@ -165,7 +165,7 @@ def status_conf_spec(allow_from, extended_status)
end
it 'should expect to succeed regular expression validation' do
expect {
- should contain_file("status.conf")
+ is_expected.to contain_file("status.conf")
}.not_to raise_error()
end
end
@@ -189,7 +189,7 @@ def status_conf_spec(allow_from, extended_status)
end
it 'should expect to fail regular expression validation' do
expect {
- should contain_file("status.conf")
+ is_expected.to contain_file("status.conf")
}.to raise_error(Puppet::Error)
end
end
diff --git a/spec/classes/mod/suphp_spec.rb b/spec/classes/mod/suphp_spec.rb
index cb91997ac..b74b4c864 100644
--- a/spec/classes/mod/suphp_spec.rb
+++ b/spec/classes/mod/suphp_spec.rb
@@ -17,8 +17,8 @@
:path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
}
end
- it { should contain_class("apache::params") }
- it { should contain_package("libapache2-mod-suphp") }
+ it { is_expected.to contain_class("apache::params") }
+ it { is_expected.to contain_package("libapache2-mod-suphp") }
end
context "on a RedHat OS" do
let :facts do
@@ -32,7 +32,7 @@
:path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
}
end
- it { should contain_class("apache::params") }
- it { should contain_package("mod_suphp") }
+ it { is_expected.to contain_class("apache::params") }
+ it { is_expected.to contain_package("mod_suphp") }
end
end
diff --git a/spec/classes/mod/worker_spec.rb b/spec/classes/mod/worker_spec.rb
index 3c9c1cf24..c0a790b18 100644
--- a/spec/classes/mod/worker_spec.rb
+++ b/spec/classes/mod/worker_spec.rb
@@ -17,10 +17,10 @@
:path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
}
end
- it { should contain_class("apache::params") }
- it { should_not contain_apache__mod('worker') }
- it { should contain_file("/etc/apache2/mods-available/worker.conf").with_ensure('file') }
- it { should contain_file("/etc/apache2/mods-enabled/worker.conf").with_ensure('link') }
+ it { is_expected.to contain_class("apache::params") }
+ it { is_expected.not_to contain_apache__mod('worker') }
+ it { is_expected.to contain_file("/etc/apache2/mods-available/worker.conf").with_ensure('file') }
+ it { is_expected.to contain_file("/etc/apache2/mods-enabled/worker.conf").with_ensure('link') }
context "with Apache version < 2.4" do
let :params do
@@ -29,10 +29,10 @@
}
end
- it { should_not contain_file("/etc/apache2/mods-available/worker.load") }
- it { should_not contain_file("/etc/apache2/mods-enabled/worker.load") }
+ it { is_expected.not_to contain_file("/etc/apache2/mods-available/worker.load") }
+ it { is_expected.not_to contain_file("/etc/apache2/mods-enabled/worker.load") }
- it { should contain_package("apache2-mpm-worker") }
+ it { is_expected.to contain_package("apache2-mpm-worker") }
end
context "with Apache version >= 2.4" do
@@ -42,12 +42,12 @@
}
end
- it { should contain_file("/etc/apache2/mods-available/worker.load").with({
+ it { is_expected.to contain_file("/etc/apache2/mods-available/worker.load").with({
'ensure' => 'file',
'content' => "LoadModule mpm_worker_module /usr/lib/apache2/modules/mod_mpm_worker.so\n"
})
}
- it { should contain_file("/etc/apache2/mods-enabled/worker.load").with_ensure('link') }
+ it { is_expected.to contain_file("/etc/apache2/mods-enabled/worker.load").with_ensure('link') }
end
end
context "on a RedHat OS" do
@@ -62,9 +62,9 @@
:path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
}
end
- it { should contain_class("apache::params") }
- it { should_not contain_apache__mod('worker') }
- it { should contain_file("/etc/httpd/conf.d/worker.conf").with_ensure('file') }
+ it { is_expected.to contain_class("apache::params") }
+ it { is_expected.not_to contain_apache__mod('worker') }
+ it { is_expected.to contain_file("/etc/httpd/conf.d/worker.conf").with_ensure('file') }
context "with Apache version < 2.4" do
let :params do
@@ -73,7 +73,7 @@
}
end
- it { should contain_file_line("/etc/sysconfig/httpd worker enable").with({
+ it { is_expected.to contain_file_line("/etc/sysconfig/httpd worker enable").with({
'require' => 'Package[httpd]',
})
}
@@ -86,9 +86,9 @@
}
end
- it { should_not contain_apache__mod('event') }
+ it { is_expected.not_to contain_apache__mod('event') }
- it { should contain_file("/etc/httpd/conf.d/worker.load").with({
+ it { is_expected.to contain_file("/etc/httpd/conf.d/worker.load").with({
'ensure' => 'file',
'content' => "LoadModule mpm_worker_module modules/mod_mpm_worker.so\n",
})
@@ -107,8 +107,8 @@
:path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
}
end
- it { should contain_class("apache::params") }
- it { should_not contain_apache__mod('worker') }
- it { should contain_file("/usr/local/etc/apache22/Modules/worker.conf").with_ensure('file') }
+ it { is_expected.to contain_class("apache::params") }
+ it { is_expected.not_to contain_apache__mod('worker') }
+ it { is_expected.to contain_file("/usr/local/etc/apache22/Modules/worker.conf").with_ensure('file') }
end
end
diff --git a/spec/classes/mod/wsgi_spec.rb b/spec/classes/mod/wsgi_spec.rb
index d4c391a29..5945e3beb 100644
--- a/spec/classes/mod/wsgi_spec.rb
+++ b/spec/classes/mod/wsgi_spec.rb
@@ -17,9 +17,9 @@
:path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
}
end
- it { should contain_class("apache::params") }
- it { should contain_apache__mod('wsgi') }
- it { should contain_package("libapache2-mod-wsgi") }
+ it { is_expected.to contain_class("apache::params") }
+ it { is_expected.to contain_apache__mod('wsgi') }
+ it { is_expected.to contain_package("libapache2-mod-wsgi") }
end
context "on a RedHat OS" do
let :facts do
@@ -33,21 +33,21 @@
:path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
}
end
- it { should contain_class("apache::params") }
- it { should contain_apache__mod('wsgi') }
- it { should contain_package("mod_wsgi") }
+ it { is_expected.to contain_class("apache::params") }
+ it { is_expected.to contain_apache__mod('wsgi') }
+ it { is_expected.to contain_package("mod_wsgi") }
describe "with custom WSGISocketPrefix" do
let :params do
{ :wsgi_socket_prefix => 'run/wsgi' }
end
- it {should contain_file('wsgi.conf').with_content(/^ WSGISocketPrefix run\/wsgi$/)}
+ it {is_expected.to contain_file('wsgi.conf').with_content(/^ WSGISocketPrefix run\/wsgi$/)}
end
describe "with custom WSGIPythonHome" do
let :params do
{ :wsgi_python_home => '/path/to/virtenv' }
end
- it {should contain_file('wsgi.conf').with_content(/^ WSGIPythonHome "\/path\/to\/virtenv"$/)}
+ it {is_expected.to contain_file('wsgi.conf').with_content(/^ WSGIPythonHome "\/path\/to\/virtenv"$/)}
end
end
context "on a FreeBSD OS" do
@@ -62,8 +62,8 @@
:path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
}
end
- it { should contain_class("apache::params") }
- it { should contain_apache__mod('wsgi') }
- it { should contain_package("www/mod_wsgi") }
+ it { is_expected.to contain_class("apache::params") }
+ it { is_expected.to contain_apache__mod('wsgi') }
+ it { is_expected.to contain_package("www/mod_wsgi") }
end
end
diff --git a/spec/classes/params_spec.rb b/spec/classes/params_spec.rb
index eaa178c41..6f63758a3 100644
--- a/spec/classes/params_spec.rb
+++ b/spec/classes/params_spec.rb
@@ -14,13 +14,13 @@
:path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
}
end
- it { should contain_apache__params }
+ it { is_expected.to contain_apache__params }
# There are 4 resources in this class currently
# there should not be any more resources because it is a params class
# The resources are class[apache::version], class[apache::params], class[main], class[settings], stage[main]
it "Should not contain any resources" do
- subject.resources.size.should == 5
+ expect(subject.resources.size).to eq(5)
end
end
end
diff --git a/spec/classes/service_spec.rb b/spec/classes/service_spec.rb
index 2cd075357..4d6efbe3f 100644
--- a/spec/classes/service_spec.rb
+++ b/spec/classes/service_spec.rb
@@ -17,7 +17,7 @@
:path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
}
end
- it { should contain_service("httpd").with(
+ it { is_expected.to contain_service("httpd").with(
'name' => 'apache2',
'ensure' => 'running',
'enable' => 'true'
@@ -26,7 +26,7 @@
context "with $service_name => 'foo'" do
let (:params) {{ :service_name => 'foo' }}
- it { should contain_service("httpd").with(
+ it { is_expected.to contain_service("httpd").with(
'name' => 'foo'
)
}
@@ -34,7 +34,7 @@
context "with $service_enable => true" do
let (:params) {{ :service_enable => true }}
- it { should contain_service("httpd").with(
+ it { is_expected.to contain_service("httpd").with(
'name' => 'apache2',
'ensure' => 'running',
'enable' => 'true'
@@ -44,7 +44,7 @@
context "with $service_enable => false" do
let (:params) {{ :service_enable => false }}
- it { should contain_service("httpd").with(
+ it { is_expected.to contain_service("httpd").with(
'name' => 'apache2',
'ensure' => 'running',
'enable' => 'false'
@@ -62,7 +62,7 @@
context "with $service_ensure => 'running'" do
let (:params) {{ :service_ensure => 'running', }}
- it { should contain_service("httpd").with(
+ it { is_expected.to contain_service("httpd").with(
'ensure' => 'running',
'enable' => 'true'
)
@@ -71,7 +71,7 @@
context "with $service_ensure => 'stopped'" do
let (:params) {{ :service_ensure => 'stopped', }}
- it { should contain_service("httpd").with(
+ it { is_expected.to contain_service("httpd").with(
'ensure' => 'stopped',
'enable' => 'true'
)
@@ -80,7 +80,7 @@
context "with $service_ensure => 'UNDEF'" do
let (:params) {{ :service_ensure => 'UNDEF' }}
- it { should contain_service("httpd").without_ensure }
+ it { is_expected.to contain_service("httpd").without_ensure }
end
end
@@ -97,7 +97,7 @@
:path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
}
end
- it { should contain_service("httpd").with(
+ it { is_expected.to contain_service("httpd").with(
'name' => 'httpd',
'ensure' => 'running',
'enable' => 'true'
@@ -117,7 +117,7 @@
:path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
}
end
- it { should contain_service("httpd").with(
+ it { is_expected.to contain_service("httpd").with(
'name' => 'apache22',
'ensure' => 'running',
'enable' => 'true'