Skip to content

Commit

Permalink
Merge pull request #763 from apenney/rspec3
Browse files Browse the repository at this point in the history
WIP:  Lets talk about before merging! - Rspec3 conversion.
  • Loading branch information
Ashley Penney committed Jun 26, 2014
2 parents 0a2575b + 2d3724d commit 23818ac
Show file tree
Hide file tree
Showing 51 changed files with 826 additions and 826 deletions.
104 changes: 52 additions & 52 deletions spec/acceptance/apache_parameters_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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

Expand All @@ -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

Expand All @@ -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

Expand All @@ -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

Expand All @@ -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
Expand All @@ -120,8 +120,8 @@ class { 'apache':
end

describe file($vhost) do
it { should be_file }
it { should contain 'ServerAdmin [email protected]' }
it { is_expected.to be_file }
it { is_expected.to contain 'ServerAdmin [email protected]' }
end
end

Expand All @@ -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
Expand All @@ -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

Expand All @@ -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

Expand All @@ -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

Expand All @@ -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

Expand All @@ -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

Expand All @@ -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
Expand All @@ -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

Expand All @@ -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

Expand All @@ -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

Expand All @@ -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

Expand All @@ -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

Expand Down Expand Up @@ -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

Expand All @@ -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

Expand All @@ -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

Expand All @@ -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

Expand All @@ -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

Expand All @@ -439,7 +439,7 @@ class { 'apache':
end

describe package($package_name) do
it { should be_installed }
it { is_expected.to be_installed }
end
end

Expand Down
42 changes: 21 additions & 21 deletions spec/acceptance/apache_ssl_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down
10 changes: 5 additions & 5 deletions spec/acceptance/class_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Loading

0 comments on commit 23818ac

Please sign in to comment.