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/classes

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

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

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

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

For more details: https://github.com/yujinakayama/transpec#supported-conversions
  • Loading branch information
Ashley Penney committed Jun 6, 2014
1 parent a6c1fbc commit 815f5cd
Show file tree
Hide file tree
Showing 32 changed files with 435 additions and 435 deletions.
182 changes: 91 additions & 91 deletions spec/classes/apache_spec.rb

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions spec/classes/dev_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -37,6 +37,6 @@
:operatingsystemrelease => '9',
}
end
it { should contain_class("apache::params") }
it { is_expected.to contain_class("apache::params") }
end
end
18 changes: 9 additions & 9 deletions spec/classes/mod/auth_kerb_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
24 changes: 12 additions & 12 deletions spec/classes/mod/authnz_ldap_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
18 changes: 9 additions & 9 deletions spec/classes/mod/dav_svn_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
12 changes: 6 additions & 6 deletions spec/classes/mod/deflate_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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"\
Expand Down Expand Up @@ -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',
} ) }
Expand All @@ -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
Expand All @@ -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',
} ) }
Expand Down
2 changes: 1 addition & 1 deletion spec/classes/mod/dev_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
:operatingsystemrelease => operatingsystemrelease,
}
end
it { should contain_class('apache::dev') }
it { is_expected.to contain_class('apache::dev') }
end
end
end
66 changes: 33 additions & 33 deletions spec/classes/mod/dir_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Loading

0 comments on commit 815f5cd

Please sign in to comment.