diff --git a/spec/acceptance/apache_parameters_spec.rb b/spec/acceptance/apache_parameters_spec.rb index 4fa3bf6ec6..54b4242251 100644 --- a/spec/acceptance/apache_parameters_spec.rb +++ b/spec/acceptance/apache_parameters_spec.rb @@ -12,7 +12,7 @@ if fact('osfamily') == 'FreeBSD' describe file("#{confd_dir}/no-accf.conf.erb") do - it { should_not be_file } + it { is_expected.not_to be_file } end end end @@ -24,7 +24,7 @@ if fact('osfamily') == 'FreeBSD' describe file("#{$confd_dir}/no-accf.conf.erb") do - it { should be_file } + it { is_expected.to be_file } end end end @@ -36,8 +36,8 @@ end describe file($ports_file) do - it { should be_file } - it { should contain 'Listen 10.1.1.1' } + it { is_expected.to be_file } + it { is_expected.to contain 'Listen 10.1.1.1' } end end @@ -53,8 +53,8 @@ class { 'apache': end describe service($service_name) do - it { should be_running } - it { should be_enabled } + it { is_expected.to be_running } + it { is_expected.to be_enabled } end end @@ -70,8 +70,8 @@ class { 'apache': end describe service($service_name) do - it { should_not be_running } - it { should_not be_enabled } + it { is_expected.not_to be_running } + it { is_expected.not_to be_enabled } end end @@ -89,7 +89,7 @@ class { 'apache': # Ensure the file didn't disappear. describe file("#{$confd_dir}/test.conf") do - it { should be_file } + it { is_expected.to be_file } end end @@ -108,7 +108,7 @@ class { 'apache': # File should be gone describe file("#{$confd_dir}/test.conf") do - it { should_not be_file } + it { is_expected.not_to be_file } end end end @@ -120,8 +120,8 @@ class { 'apache': end describe file($vhost) do - it { should be_file } - it { should contain 'ServerAdmin test@example.com' } + it { is_expected.to be_file } + it { is_expected.to contain 'ServerAdmin test@example.com' } end end @@ -134,8 +134,8 @@ class { 'apache': end describe file($conf_file) do - it { should be_file } - it { should contain 'EnableSendfile On' } + it { is_expected.to be_file } + it { is_expected.to contain 'EnableSendfile On' } end describe 'setup' do @@ -146,8 +146,8 @@ class { 'apache': end describe file($conf_file) do - it { should be_file } - it { should contain 'Sendfile Off' } + it { is_expected.to be_file } + it { is_expected.to contain 'Sendfile Off' } end end @@ -160,8 +160,8 @@ class { 'apache': end describe file($conf_file) do - it { should be_file } - it { should contain 'Alias /error/' } + it { is_expected.to be_file } + it { is_expected.to contain 'Alias /error/' } end end @@ -174,8 +174,8 @@ class { 'apache': end describe file($conf_file) do - it { should be_file } - it { should contain 'Timeout 1234' } + it { is_expected.to be_file } + it { is_expected.to contain 'Timeout 1234' } end end @@ -191,8 +191,8 @@ class { 'apache': httpd_dir => '/tmp', service_ensure => stopped } end describe file("#{$confd_dir}/mime.conf") do - it { should be_file } - it { should contain 'AddLanguage eo .eo' } + it { is_expected.to be_file } + it { is_expected.to contain 'AddLanguage eo .eo' } end end @@ -205,8 +205,8 @@ class { 'apache': httpd_dir => '/tmp', service_ensure => stopped } end describe file($conf_file) do - it { should be_file } - it { should contain 'ServerRoot "/tmp/root"' } + it { is_expected.to be_file } + it { is_expected.to contain 'ServerRoot "/tmp/root"' } end end @@ -220,13 +220,13 @@ class { 'apache': httpd_dir => '/tmp', service_ensure => stopped } if $apache_version == '2.4' describe file($conf_file) do - it { should be_file } - it { should contain 'IncludeOptional "/tmp/root/*.conf"' } + it { is_expected.to be_file } + it { is_expected.to contain 'IncludeOptional "/tmp/root/*.conf"' } end else describe file($conf_file) do - it { should be_file } - it { should contain 'Include "/tmp/root/*.conf"' } + it { is_expected.to be_file } + it { is_expected.to contain 'Include "/tmp/root/*.conf"' } end end end @@ -242,8 +242,8 @@ class { 'apache': httpd_dir => '/tmp', service_ensure => stopped } end describe file($conf_file) do - it { should be_file } - it { should contain 'testcontent' } + it { is_expected.to be_file } + it { is_expected.to contain 'testcontent' } end end @@ -256,8 +256,8 @@ class { 'apache': httpd_dir => '/tmp', service_ensure => stopped } end describe file($conf_file) do - it { should be_file } - it { should contain 'ServerName "test.server"' } + it { is_expected.to be_file } + it { is_expected.to contain 'ServerName "test.server"' } end end @@ -277,12 +277,12 @@ class { 'apache': end describe user('testweb') do - it { should exist } - it { should belong_to_group 'testweb' } + it { is_expected.to exist } + it { is_expected.to belong_to_group 'testweb' } end describe group('testweb') do - it { should exist } + it { is_expected.to exist } end end @@ -302,9 +302,9 @@ class { 'apache': end describe file($conf_file) do - it { should be_file } - it { should contain 'LogFormat "%v %h %l %u %t \"%r\" %>s %b" vhost_common' } - it { should contain 'LogFormat "%v %h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\"" vhost_combined' } + it { is_expected.to be_file } + it { is_expected.to contain 'LogFormat "%v %h %l %u %t \"%r\" %>s %b" vhost_common' } + it { is_expected.to contain 'LogFormat "%v %h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\"" vhost_combined' } end end @@ -318,10 +318,10 @@ class { 'apache': end describe file($conf_file) do - it { should be_file } - it { should contain 'KeepAlive On' } - it { should contain 'KeepAliveTimeout 30' } - it { should contain 'MaxKeepAliveRequests 200' } + it { is_expected.to be_file } + it { is_expected.to contain 'KeepAlive On' } + it { is_expected.to contain 'KeepAliveTimeout 30' } + it { is_expected.to contain 'MaxKeepAliveRequests 200' } end end @@ -356,7 +356,7 @@ class { 'apache': logroot => '/apache_spec' } end describe file("/apache_spec/#{$error_log}") do - it { should be_file } + it { is_expected.to be_file } end end @@ -374,8 +374,8 @@ class { 'apache': end describe file('/apache_spec/ports_file') do - it { should be_file } - it { should contain 'Listen 10.1.1.1' } + it { is_expected.to be_file } + it { is_expected.to contain 'Listen 10.1.1.1' } end end @@ -390,8 +390,8 @@ class { 'apache': end describe file($conf_file) do - it { should be_file } - it { should contain 'ServerTokens Minor' } + it { is_expected.to be_file } + it { is_expected.to contain 'ServerTokens Minor' } end end @@ -407,8 +407,8 @@ class { 'apache': end describe file($conf_file) do - it { should be_file } - it { should contain 'ServerSignature testsig' } + it { is_expected.to be_file } + it { is_expected.to contain 'ServerSignature testsig' } end end @@ -423,8 +423,8 @@ class { 'apache': end describe file($conf_file) do - it { should be_file } - it { should contain 'TraceEnable Off' } + it { is_expected.to be_file } + it { is_expected.to contain 'TraceEnable Off' } end end @@ -439,7 +439,7 @@ class { 'apache': end describe package($package_name) do - it { should be_installed } + it { is_expected.to be_installed } end end diff --git a/spec/acceptance/apache_ssl_spec.rb b/spec/acceptance/apache_ssl_spec.rb index 649c02d841..3cfe593481 100644 --- a/spec/acceptance/apache_ssl_spec.rb +++ b/spec/acceptance/apache_ssl_spec.rb @@ -27,13 +27,13 @@ class { 'apache': end describe file("#{vhostd}/15-default-ssl.conf") do - it { should be_file } - it { should contain 'SSLCertificateFile "/tmp/ssl_cert"' } - it { should contain 'SSLCertificateKeyFile "/tmp/ssl_key"' } - it { should contain 'SSLCertificateChainFile "/tmp/ssl_chain"' } - it { should contain 'SSLCACertificateFile "/tmp/ssl_ca"' } - it { should contain 'SSLCARevocationPath "/tmp/ssl_crl_path"' } - it { should contain 'SSLCARevocationFile "/tmp/ssl_crl"' } + it { is_expected.to be_file } + it { is_expected.to contain 'SSLCertificateFile "/tmp/ssl_cert"' } + it { is_expected.to contain 'SSLCertificateKeyFile "/tmp/ssl_key"' } + it { is_expected.to contain 'SSLCertificateChainFile "/tmp/ssl_chain"' } + it { is_expected.to contain 'SSLCACertificateFile "/tmp/ssl_ca"' } + it { is_expected.to contain 'SSLCARevocationPath "/tmp/ssl_crl_path"' } + it { is_expected.to contain 'SSLCARevocationFile "/tmp/ssl_crl"' } end end @@ -67,20 +67,20 @@ class { 'apache': end describe file("#{vhostd}/25-test_ssl.conf") do - it { should be_file } - it { should contain 'SSLCertificateFile "/tmp/ssl_cert"' } - it { should contain 'SSLCertificateKeyFile "/tmp/ssl_key"' } - it { should contain 'SSLCertificateChainFile "/tmp/ssl_chain"' } - it { should contain 'SSLCACertificateFile "/tmp/ssl_ca"' } - it { should contain 'SSLCARevocationPath "/tmp/ssl_crl_path"' } - it { should contain 'SSLCARevocationFile "/tmp/ssl_crl"' } - it { should contain 'SSLProxyEngine On' } - it { should contain 'SSLProtocol test' } - it { should contain 'SSLCipherSuite test' } - it { should contain 'SSLHonorCipherOrder test' } - it { should contain 'SSLVerifyClient test' } - it { should contain 'SSLVerifyDepth test' } - it { should contain 'SSLOptions test test1' } + it { is_expected.to be_file } + it { is_expected.to contain 'SSLCertificateFile "/tmp/ssl_cert"' } + it { is_expected.to contain 'SSLCertificateKeyFile "/tmp/ssl_key"' } + it { is_expected.to contain 'SSLCertificateChainFile "/tmp/ssl_chain"' } + it { is_expected.to contain 'SSLCACertificateFile "/tmp/ssl_ca"' } + it { is_expected.to contain 'SSLCARevocationPath "/tmp/ssl_crl_path"' } + it { is_expected.to contain 'SSLCARevocationFile "/tmp/ssl_crl"' } + it { is_expected.to contain 'SSLProxyEngine On' } + it { is_expected.to contain 'SSLProtocol test' } + it { is_expected.to contain 'SSLCipherSuite test' } + it { is_expected.to contain 'SSLHonorCipherOrder test' } + it { is_expected.to contain 'SSLVerifyClient test' } + it { is_expected.to contain 'SSLVerifyDepth test' } + it { is_expected.to contain 'SSLOptions test test1' } end end diff --git a/spec/acceptance/class_spec.rb b/spec/acceptance/class_spec.rb index 830e3ed5b6..d9b80b5c35 100644 --- a/spec/acceptance/class_spec.rb +++ b/spec/acceptance/class_spec.rb @@ -25,12 +25,12 @@ class { 'apache': } end describe package(package_name) do - it { should be_installed } + it { is_expected.to be_installed } end describe service(service_name) do - it { should be_enabled } - it { should be_running } + it { is_expected.to be_enabled } + it { is_expected.to be_running } end end @@ -71,8 +71,8 @@ class { 'apache': end describe service(service_name) do - it { should be_enabled } - it { should be_running } + it { is_expected.to be_enabled } + it { is_expected.to be_running } end end end diff --git a/spec/acceptance/default_mods_spec.rb b/spec/acceptance/default_mods_spec.rb index c7f8755605..2565ce77b9 100644 --- a/spec/acceptance/default_mods_spec.rb +++ b/spec/acceptance/default_mods_spec.rb @@ -28,7 +28,7 @@ class { 'apache': end describe service(servicename) do - it { should be_running } + it { is_expected.to be_running } end end @@ -54,7 +54,7 @@ class { 'apache': # Are these the same? describe service(servicename) do - it { should_not be_running } + it { is_expected.not_to be_running } end describe "service #{servicename}" do it 'should not be running' do @@ -92,7 +92,7 @@ class { 'apache': end describe service(servicename) do - it { should be_running } + it { is_expected.to be_running } end end @@ -110,11 +110,11 @@ class { 'apache': default_mods => false } end describe service(servicename) do - it { should be_running } + it { is_expected.to be_running } end describe file("#{mod_dir}/zz_auth_basic.load") do - it { should be_file } + it { is_expected.to be_file } end end end diff --git a/spec/acceptance/itk_spec.rb b/spec/acceptance/itk_spec.rb index 86fc2c01ce..b810657ec3 100644 --- a/spec/acceptance/itk_spec.rb +++ b/spec/acceptance/itk_spec.rb @@ -27,7 +27,7 @@ class { 'apache': end describe service(service_name) do - it { should be_running } - it { should be_enabled } + it { is_expected.to be_running } + it { is_expected.to be_enabled } end end diff --git a/spec/acceptance/mod_dav_svn_spec.rb b/spec/acceptance/mod_dav_svn_spec.rb index 412b794540..ff90d331f3 100644 --- a/spec/acceptance/mod_dav_svn_spec.rb +++ b/spec/acceptance/mod_dav_svn_spec.rb @@ -23,12 +23,12 @@ class { 'apache': } end describe service(service_name) do - it { should be_enabled } - it { should be_running } + it { is_expected.to be_enabled } + it { is_expected.to be_running } end describe file("#{mod_dir}/dav_svn.load") do - it { should contain "LoadModule dav_svn_module" } + it { is_expected.to contain "LoadModule dav_svn_module" } end end @@ -44,12 +44,12 @@ class { 'apache::mod::dav_svn': end describe service(service_name) do - it { should be_enabled } - it { should be_running } + it { is_expected.to be_enabled } + it { is_expected.to be_running } end describe file("#{mod_dir}/dav_svn_authz_svn.load") do - it { should contain "LoadModule authz_svn_module" } + it { is_expected.to contain "LoadModule authz_svn_module" } end end end diff --git a/spec/acceptance/mod_deflate_spec.rb b/spec/acceptance/mod_deflate_spec.rb index b2ffc1436a..6052cc283f 100644 --- a/spec/acceptance/mod_deflate_spec.rb +++ b/spec/acceptance/mod_deflate_spec.rb @@ -23,18 +23,18 @@ class { 'apache': } end describe service(service_name) do - it { should be_enabled } - it { should be_running } + it { is_expected.to be_enabled } + it { is_expected.to be_running } end describe file("#{mod_dir}/deflate.conf") do - it { should contain "AddOutputFilterByType DEFLATE text/html text/plain text/xml" } - it { should contain "AddOutputFilterByType DEFLATE text/css" } - it { should contain "AddOutputFilterByType DEFLATE application/x-javascript application/javascript application/ecmascript" } - it { should contain "AddOutputFilterByType DEFLATE application/rss+xml" } - it { should contain "DeflateFilterNote Input instream" } - it { should contain "DeflateFilterNote Output outstream" } - it { should contain "DeflateFilterNote Ratio ratio" } + it { is_expected.to contain "AddOutputFilterByType DEFLATE text/html text/plain text/xml" } + it { is_expected.to contain "AddOutputFilterByType DEFLATE text/css" } + it { is_expected.to contain "AddOutputFilterByType DEFLATE application/x-javascript application/javascript application/ecmascript" } + it { is_expected.to contain "AddOutputFilterByType DEFLATE application/rss+xml" } + it { is_expected.to contain "DeflateFilterNote Input instream" } + it { is_expected.to contain "DeflateFilterNote Output outstream" } + it { is_expected.to contain "DeflateFilterNote Ratio ratio" } end end end diff --git a/spec/acceptance/mod_fcgid_spec.rb b/spec/acceptance/mod_fcgid_spec.rb index 52f793be06..8e94fa08fa 100644 --- a/spec/acceptance/mod_fcgid_spec.rb +++ b/spec/acceptance/mod_fcgid_spec.rb @@ -43,14 +43,14 @@ class { 'apache::mod::fcgid': end describe service('httpd') do - it { should be_enabled } - it { should be_running } + it { is_expected.to be_enabled } + it { is_expected.to be_running } end it 'should answer to fcgid.example.com' do shell("/usr/bin/curl -H 'Host: fcgid.example.com' 127.0.0.1:80") do |r| - r.stdout.should =~ /^Hello world$/ - r.exit_code.should == 0 + expect(r.stdout).to match(/^Hello world$/) + expect(r.exit_code).to eq(0) end end diff --git a/spec/acceptance/mod_mime_spec.rb b/spec/acceptance/mod_mime_spec.rb index 71a7037a62..e2a2512db6 100644 --- a/spec/acceptance/mod_mime_spec.rb +++ b/spec/acceptance/mod_mime_spec.rb @@ -23,12 +23,12 @@ class { 'apache': } end describe service(service_name) do - it { should be_enabled } - it { should be_running } + it { is_expected.to be_enabled } + it { is_expected.to be_running } end describe file("#{mod_dir}/mime.conf") do - it { should contain "AddType application/x-compress .Z" } + it { is_expected.to contain "AddType application/x-compress .Z" } end end end diff --git a/spec/acceptance/mod_pagespeed_spec.rb b/spec/acceptance/mod_pagespeed_spec.rb index de59a347c1..14e75b4d79 100644 --- a/spec/acceptance/mod_pagespeed_spec.rb +++ b/spec/acceptance/mod_pagespeed_spec.rb @@ -63,22 +63,22 @@ class { 'apache::mod::pagespeed': end describe service(service_name) do - it { should be_enabled } - it { should be_running } + it { is_expected.to be_enabled } + it { is_expected.to be_running } end describe file("#{mod_dir}/pagespeed.conf") do - it { should contain "AddOutputFilterByType MOD_PAGESPEED_OUTPUT_FILTER text/html" } - it { should contain "ModPagespeedEnableFilters remove_comments" } - it { should contain "ModPagespeedDisableFilters extend_cache" } - it { should contain "ModPagespeedForbidFilters rewrite_javascript" } + it { is_expected.to contain "AddOutputFilterByType MOD_PAGESPEED_OUTPUT_FILTER text/html" } + it { is_expected.to contain "ModPagespeedEnableFilters remove_comments" } + it { is_expected.to contain "ModPagespeedDisableFilters extend_cache" } + it { is_expected.to contain "ModPagespeedForbidFilters rewrite_javascript" } end it 'should answer to pagespeed.example.com and include
and be stripped of comments by mod_pagespeed' do shell("/usr/bin/curl pagespeed.example.com:80") do |r| - r.stdout.should =~ /
/ - r.stdout.should_not =~ // - r.exit_code.should == 0 + expect(r.stdout).to match(/
/)
+ expect(r.stdout).not_to match(//)
+ expect(r.exit_code).to eq(0)
end
end
end
diff --git a/spec/acceptance/mod_passenger_spec.rb b/spec/acceptance/mod_passenger_spec.rb
index fbfac1672a..3362daeb27 100644
--- a/spec/acceptance/mod_passenger_spec.rb
+++ b/spec/acceptance/mod_passenger_spec.rb
@@ -95,61 +95,61 @@ class { 'apache::mod::passenger': }
end
describe service(service_name) do
- it { should be_enabled }
- it { should be_running }
+ it { is_expected.to be_enabled }
+ it { is_expected.to be_running }
end
describe file(conf_file) do
- it { should contain "PassengerRoot \"#{passenger_root}\"" }
+ it { is_expected.to contain "PassengerRoot \"#{passenger_root}\"" }
case fact('operatingsystem')
when 'Ubuntu'
case fact('lsbdistrelease')
when '10.04'
- it { should contain "PassengerRuby \"#{passenger_ruby}\"" }
- it { should_not contain "/PassengerDefaultRuby/" }
+ it { is_expected.to contain "PassengerRuby \"#{passenger_ruby}\"" }
+ it { is_expected.not_to contain "/PassengerDefaultRuby/" }
when '12.04'
- it { should contain "PassengerRuby \"#{passenger_ruby}\"" }
- it { should_not contain "/PassengerDefaultRuby/" }
+ it { is_expected.to contain "PassengerRuby \"#{passenger_ruby}\"" }
+ it { is_expected.not_to contain "/PassengerDefaultRuby/" }
when '14.04'
- it { should contain "PassengerDefaultRuby \"#{passenger_ruby}\"" }
- it { should_not contain "/PassengerRuby/" }
+ it { is_expected.to contain "PassengerDefaultRuby \"#{passenger_ruby}\"" }
+ it { is_expected.not_to contain "/PassengerRuby/" }
else
# This may or may not work on Ubuntu releases other than the above
- it { should contain "PassengerRuby \"#{passenger_ruby}\"" }
- it { should_not contain "/PassengerDefaultRuby/" }
+ it { is_expected.to contain "PassengerRuby \"#{passenger_ruby}\"" }
+ it { is_expected.not_to contain "/PassengerDefaultRuby/" }
end
when 'Debian'
case fact('lsbdistcodename')
when 'wheezy'
- it { should contain "PassengerRuby \"#{passenger_ruby}\"" }
- it { should_not contain "/PassengerDefaultRuby/" }
+ it { is_expected.to contain "PassengerRuby \"#{passenger_ruby}\"" }
+ it { is_expected.not_to contain "/PassengerDefaultRuby/" }
else
# This may or may not work on Debian releases other than the above
- it { should contain "PassengerRuby \"#{passenger_ruby}\"" }
- it { should_not contain "/PassengerDefaultRuby/" }
+ it { is_expected.to contain "PassengerRuby \"#{passenger_ruby}\"" }
+ it { is_expected.not_to contain "/PassengerDefaultRuby/" }
end
end
end
describe file(load_file) do
- it { should contain "LoadModule passenger_module #{passenger_module_path}" }
+ it { is_expected.to contain "LoadModule passenger_module #{passenger_module_path}" }
end
it 'should output status via passenger-memory-stats' do
shell("sudo /usr/sbin/passenger-memory-stats") do |r|
- r.stdout.should =~ /Apache processes/
- r.stdout.should =~ /Nginx processes/
- r.stdout.should =~ /Passenger processes/
+ expect(r.stdout).to match(/Apache processes/)
+ expect(r.stdout).to match(/Nginx processes/)
+ expect(r.stdout).to match(/Passenger processes/)
# passenger-memory-stats output on Ubuntu 14.04 does not contain
# these two lines
unless fact('operatingsystem') == 'Ubuntu' && fact('operatingsystemrelease') == '14.04'
- r.stdout.should =~ /### Processes: [0-9]+/
- r.stdout.should =~ /### Total private dirty RSS: [0-9\.]+ MB/
+ expect(r.stdout).to match(/### Processes: [0-9]+/)
+ expect(r.stdout).to match(/### Total private dirty RSS: [0-9\.]+ MB/)
end
- r.exit_code.should == 0
+ expect(r.exit_code).to eq(0)
end
end
@@ -160,28 +160,28 @@ class { 'apache::mod::passenger': }
# xml output not available on ubunutu <= 10.04, so sticking with default pool output
shell("sudo /usr/sbin/passenger-status") do |r|
# spacing may vary
- r.stdout.should =~ /[\-]+ General information [\-]+/
+ expect(r.stdout).to match(/[\-]+ General information [\-]+/)
if fact('operatingsystem') == 'Ubuntu' && fact('operatingsystemrelease') == '14.04'
- r.stdout.should =~ /Max pool size[ ]+: [0-9]+/
- r.stdout.should =~ /Processes[ ]+: [0-9]+/
- r.stdout.should =~ /Requests in top-level queue[ ]+: [0-9]+/
+ expect(r.stdout).to match(/Max pool size[ ]+: [0-9]+/)
+ expect(r.stdout).to match(/Processes[ ]+: [0-9]+/)
+ expect(r.stdout).to match(/Requests in top-level queue[ ]+: [0-9]+/)
else
- r.stdout.should =~ /max[ ]+= [0-9]+/
- r.stdout.should =~ /count[ ]+= [0-9]+/
- r.stdout.should =~ /active[ ]+= [0-9]+/
- r.stdout.should =~ /inactive[ ]+= [0-9]+/
- r.stdout.should =~ /Waiting on global queue: [0-9]+/
+ expect(r.stdout).to match(/max[ ]+= [0-9]+/)
+ expect(r.stdout).to match(/count[ ]+= [0-9]+/)
+ expect(r.stdout).to match(/active[ ]+= [0-9]+/)
+ expect(r.stdout).to match(/inactive[ ]+= [0-9]+/)
+ expect(r.stdout).to match(/Waiting on global queue: [0-9]+/)
end
- r.exit_code.should == 0
+ expect(r.exit_code).to eq(0)
end
end
end
it 'should answer to passenger.example.com' do
shell("/usr/bin/curl passenger.example.com:80") do |r|
- r.stdout.should =~ /^hello world<\/b>$/
- r.exit_code.should == 0
+ expect(r.stdout).to match(/^hello world<\/b>$/)
+ expect(r.exit_code).to eq(0)
end
end
@@ -240,50 +240,50 @@ class { 'apache::mod::passenger':
end
describe service(service_name) do
- it { should be_enabled }
- it { should be_running }
+ it { is_expected.to be_enabled }
+ it { is_expected.to be_running }
end
describe file(conf_file) do
- it { should contain "PassengerRoot #{passenger_root}" }
- it { should contain "PassengerRuby #{passenger_ruby}" }
- it { should contain "PassengerTempDir #{passenger_tempdir}" }
+ it { is_expected.to contain "PassengerRoot #{passenger_root}" }
+ it { is_expected.to contain "PassengerRuby #{passenger_ruby}" }
+ it { is_expected.to contain "PassengerTempDir #{passenger_tempdir}" }
end
describe file(load_file) do
- it { should contain "LoadModule passenger_module #{passenger_module_path}" }
+ it { is_expected.to contain "LoadModule passenger_module #{passenger_module_path}" }
end
it 'should output status via passenger-memory-stats' do
shell("sudo /usr/bin/passenger-memory-stats") do |r|
- r.stdout.should =~ /Apache processes/
- r.stdout.should =~ /Nginx processes/
- r.stdout.should =~ /Passenger processes/
- r.stdout.should =~ /### Processes: [0-9]+/
- r.stdout.should =~ /### Total private dirty RSS: [0-9\.]+ MB/
+ expect(r.stdout).to match(/Apache processes/)
+ expect(r.stdout).to match(/Nginx processes/)
+ expect(r.stdout).to match(/Passenger processes/)
+ expect(r.stdout).to match(/### Processes: [0-9]+/)
+ expect(r.stdout).to match(/### Total private dirty RSS: [0-9\.]+ MB/)
- r.exit_code.should == 0
+ expect(r.exit_code).to eq(0)
end
end
it 'should output status via passenger-status' do
shell("sudo PASSENGER_TMPDIR=/var/run/rubygem-passenger /usr/bin/passenger-status") do |r|
# spacing may vary
- r.stdout.should =~ /[\-]+ General information [\-]+/
- r.stdout.should =~ /max[ ]+= [0-9]+/
- r.stdout.should =~ /count[ ]+= [0-9]+/
- r.stdout.should =~ /active[ ]+= [0-9]+/
- r.stdout.should =~ /inactive[ ]+= [0-9]+/
- r.stdout.should =~ /Waiting on global queue: [0-9]+/
+ expect(r.stdout).to match(/[\-]+ General information [\-]+/)
+ expect(r.stdout).to match(/max[ ]+= [0-9]+/)
+ expect(r.stdout).to match(/count[ ]+= [0-9]+/)
+ expect(r.stdout).to match(/active[ ]+= [0-9]+/)
+ expect(r.stdout).to match(/inactive[ ]+= [0-9]+/)
+ expect(r.stdout).to match(/Waiting on global queue: [0-9]+/)
- r.exit_code.should == 0
+ expect(r.exit_code).to eq(0)
end
end
it 'should answer to passenger.example.com' do
shell("/usr/bin/curl passenger.example.com:80") do |r|
- r.stdout.should =~ /^hello world<\/b>$/
- r.exit_code.should == 0
+ expect(r.stdout).to match(/^hello world<\/b>$/)
+ expect(r.exit_code).to eq(0)
end
end
end
diff --git a/spec/acceptance/mod_php_spec.rb b/spec/acceptance/mod_php_spec.rb
index cf8054053e..0b46dbc66f 100644
--- a/spec/acceptance/mod_php_spec.rb
+++ b/spec/acceptance/mod_php_spec.rb
@@ -37,18 +37,18 @@ class { 'apache::mod::php': }
end
describe service(service_name) do
- it { should be_enabled }
- it { should be_running }
+ it { is_expected.to be_enabled }
+ it { is_expected.to be_running }
end
describe file("#{mod_dir}/php5.conf") do
- it { should contain "DirectoryIndex index.php" }
+ it { is_expected.to contain "DirectoryIndex index.php" }
end
it 'should answer to php.example.com' do
shell("/usr/bin/curl php.example.com:80") do |r|
- r.stdout.should =~ /PHP Version/
- r.exit_code.should == 0
+ expect(r.stdout).to match(/PHP Version/)
+ expect(r.exit_code).to eq(0)
end
end
end
@@ -78,19 +78,19 @@ class { 'apache::mod::php':
end
describe service(service_name) do
- it { should be_enabled }
- it { should be_running }
+ it { is_expected.to be_enabled }
+ it { is_expected.to be_running }
end
describe file("#{vhost_dir}/25-php.example.com.conf") do
- it { should contain " php_admin_flag engine on" }
- it { should contain " php_admin_value open_basedir /var/www/php/:/usr/share/pear/" }
+ it { is_expected.to contain " php_admin_flag engine on" }
+ it { is_expected.to contain " php_admin_value open_basedir /var/www/php/:/usr/share/pear/" }
end
it 'should answer to php.example.com' do
shell("/usr/bin/curl php.example.com:80") do |r|
- r.stdout.should =~ /\/usr\/share\/pear\//
- r.exit_code.should == 0
+ expect(r.stdout).to match(/\/usr\/share\/pear\//)
+ expect(r.exit_code).to eq(0)
end
end
end
diff --git a/spec/acceptance/mod_proxy_html_spec.rb b/spec/acceptance/mod_proxy_html_spec.rb
index f015f99941..eab162b1a3 100644
--- a/spec/acceptance/mod_proxy_html_spec.rb
+++ b/spec/acceptance/mod_proxy_html_spec.rb
@@ -32,8 +32,8 @@ class { 'apache::mod::proxy_html': }
end
describe service(service_name) do
- it { should be_enabled }
- it { should be_running }
+ it { is_expected.to be_enabled }
+ it { is_expected.to be_running }
end
end
end
diff --git a/spec/acceptance/mod_suphp_spec.rb b/spec/acceptance/mod_suphp_spec.rb
index 9e26731d61..1b91581441 100644
--- a/spec/acceptance/mod_suphp_spec.rb
+++ b/spec/acceptance/mod_suphp_spec.rb
@@ -27,14 +27,14 @@ class { 'apache::mod::suphp': }
end
describe service('apache2') do
- it { should be_enabled }
- it { should be_running }
+ it { is_expected.to be_enabled }
+ it { is_expected.to be_running }
end
it 'should answer to suphp.example.com' do
shell("/usr/bin/curl suphp.example.com:80") do |r|
- r.stdout.should =~ /^daemon$/
- r.exit_code.should == 0
+ expect(r.stdout).to match(/^daemon$/)
+ expect(r.exit_code).to eq(0)
end
end
end
diff --git a/spec/acceptance/prefork_worker_spec.rb b/spec/acceptance/prefork_worker_spec.rb
index beffe0a014..562ff5323d 100644
--- a/spec/acceptance/prefork_worker_spec.rb
+++ b/spec/acceptance/prefork_worker_spec.rb
@@ -28,8 +28,8 @@ class { 'apache':
end
describe service(servicename) do
- it { should be_running }
- it { should be_enabled }
+ it { is_expected.to be_running }
+ it { is_expected.to be_enabled }
end
end
end
@@ -51,8 +51,8 @@ class { 'apache':
end
describe service(servicename) do
- it { should be_running }
- it { should be_enabled }
+ it { is_expected.to be_running }
+ it { is_expected.to be_enabled }
end
end
@@ -73,7 +73,7 @@ class { 'apache':
end
describe service(servicename) do
- it { should be_running }
- it { should be_enabled }
+ it { is_expected.to be_running }
+ it { is_expected.to be_enabled }
end
end
diff --git a/spec/acceptance/vhost_spec.rb b/spec/acceptance/vhost_spec.rb
index c43d3f9e9e..259581c54f 100644
--- a/spec/acceptance/vhost_spec.rb
+++ b/spec/acceptance/vhost_spec.rb
@@ -16,11 +16,11 @@ class { 'apache':
end
describe file("#{$vhost_dir}/15-default.conf") do
- it { should_not be_file }
+ it { is_expected.not_to be_file }
end
describe file("#{$vhost_dir}/15-default-ssl.conf") do
- it { should_not be_file }
+ it { is_expected.not_to be_file }
end
end
@@ -34,11 +34,11 @@ class { 'apache': }
end
describe file("#{$vhost_dir}/15-default.conf") do
- it { should contain '