Skip to content

Commit

Permalink
Convert specs to RSpec 3.0.0 syntax with Transpec
Browse files Browse the repository at this point in the history
This conversion is done by Transpec 2.2.1 with the following command:
    transpec spec/acceptance

* 234 conversions
    from: it { should ... }
      to: it { is_expected.to ... }

* 58 conversions
    from: obj.should
      to: expect(obj).to

* 33 conversions
    from: =~ /pattern/
      to: match(/pattern/)

* 20 conversions
    from: it { should_not ... }
      to: it { is_expected.not_to ... }

* 18 conversions
    from: == expected
      to: eq(expected)

* 1 conversion
    from: obj.should_not
      to: expect(obj).not_to

For more details: https://github.com/yujinakayama/transpec#supported-conversions
  • Loading branch information
Ashley Penney committed Jun 6, 2014
1 parent 0132518 commit 2d3724d
Show file tree
Hide file tree
Showing 16 changed files with 313 additions and 313 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 test@example.com' }
it { is_expected.to be_file }
it { is_expected.to contain 'ServerAdmin test@example.com' }
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 2d3724d

Please sign in to comment.