forked from redhat-openstack/openstack-puppet-modules
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Convert specs to RSpec 2.99.1 syntax with Transpec
This conversion is done by Transpec 2.3.6 with the following command: transpec -f -c "bundle exec rake spec" * 69 conversions from: it { should ... } to: it { is_expected.to ... } * 48 conversions from: obj.should to: expect(obj).to * 34 conversions from: == expected to: eq(expected) * 4 conversions from: it { should_not ... } to: it { is_expected.not_to ... } * 3 conversions from: obj.should_not to: expect(obj).not_to * 2 conversions from: lambda { }.should to: expect { }.to * 2 conversions from: pending to: skip For more details: https://github.com/yujinakayama/transpec#supported-conversions
- Loading branch information
Ashley Penney
committed
Aug 8, 2014
1 parent
314dc1f
commit 00a191f
Showing
16 changed files
with
146 additions
and
190 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,74 +1,30 @@ | ||
require 'spec_helper' | ||
|
||
describe 'mysql::bindings' do | ||
let(:params) {{ | ||
'java_enable' => true, | ||
'perl_enable' => true, | ||
'php_enable' => true, | ||
'python_enable' => true, | ||
'ruby_enable' => true, | ||
'client_dev' => true, | ||
'daemon_dev' => true, | ||
}} | ||
|
||
shared_examples 'bindings' do |osfamily, operatingsystem, operatingsystemrelease, java_name, perl_name, php_name, python_name, ruby_name, client_dev_name, daemon_dev_name| | ||
let :facts do | ||
{ :osfamily => osfamily, :operatingsystem => operatingsystem, | ||
:operatingsystemrelease => operatingsystemrelease, :root_home => '/root', | ||
} | ||
end | ||
it { should contain_package('mysql-connector-java').with( | ||
:name => java_name, | ||
:ensure => 'present' | ||
)} | ||
it { should contain_package('perl_mysql').with( | ||
:name => perl_name, | ||
:ensure => 'present' | ||
)} | ||
it { should contain_package('python-mysqldb').with( | ||
:name => python_name, | ||
:ensure => 'present' | ||
)} | ||
it { should contain_package('ruby_mysql').with( | ||
:name => ruby_name, | ||
:ensure => 'present' | ||
)} | ||
if client_dev_name | ||
it { should contain_package('mysql-client_dev').with( | ||
:name => client_dev_name, | ||
:ensure => 'present' | ||
)} | ||
on_pe_supported_platforms(PLATFORMS).each do |pe_version,pe_platforms| | ||
pe_platforms.each do |pe_platform,facts| | ||
describe "on #{pe_version} #{pe_platform}" do | ||
let(:facts) { facts } | ||
|
||
let(:params) {{ | ||
'java_enable' => true, | ||
'perl_enable' => true, | ||
'php_enable' => true, | ||
'python_enable' => true, | ||
'ruby_enable' => true, | ||
'client_dev' => true, | ||
'daemon_dev' => true, | ||
'client_dev_package_name' => 'libmysqlclient-devel', | ||
'daemon_dev_package_name' => 'mysql-devel', | ||
}} | ||
|
||
it { is_expected.to contain_package('mysql-connector-java') } | ||
it { is_expected.to contain_package('perl_mysql') } | ||
it { is_expected.to contain_package('python-mysqldb') } | ||
it { is_expected.to contain_package('ruby_mysql') } | ||
it { is_expected.to contain_package('mysql-client_dev') } | ||
it { is_expected.to contain_package('mysql-daemon_dev') } | ||
end | ||
end | ||
if daemon_dev_name | ||
it { should contain_package('mysql-daemon_dev').with( | ||
:name => daemon_dev_name, | ||
:ensure => 'present' | ||
)} | ||
end | ||
end | ||
|
||
context 'Debian' do | ||
it_behaves_like 'bindings', 'Debian', 'Debian', '7.4','libmysql-java', 'libdbd-mysql-perl', 'php5-mysql', 'python-mysqldb', 'libmysql-ruby', 'libmysqlclient-dev', 'libmysqld-dev' | ||
it_behaves_like 'bindings', 'Debian', 'Ubuntu', '14.04', 'libmysql-java', 'libdbd-mysql-perl', 'php5-mysql', 'python-mysqldb', 'libmysql-ruby', 'libmysqlclient-dev', 'libmysqld-dev' | ||
end | ||
|
||
context 'freebsd' do | ||
it_behaves_like 'bindings', 'FreeBSD', 'FreeBSD', '10.0', 'databases/mysql-connector-java', 'p5-DBD-mysql', 'databases/php5-mysql', 'databases/py-MySQLdb', 'databases/ruby-mysql' | ||
end | ||
|
||
context 'redhat' do | ||
it_behaves_like 'bindings', 'RedHat', 'RedHat', '6.5', 'mysql-connector-java', 'perl-DBD-MySQL', 'php-mysql', 'MySQL-python', 'ruby-mysql', nil, 'mysql-devel' | ||
it_behaves_like 'bindings', 'RedHat', 'OpenSuSE', '11.3', 'mysql-connector-java', 'perl-DBD-MySQL', 'php-mysql', 'MySQL-python', 'ruby-mysql', nil, 'mysql-devel' | ||
end | ||
|
||
describe 'on any other os' do | ||
let :facts do | ||
{:osfamily => 'foo', :root_home => '/root'} | ||
end | ||
|
||
it 'should fail' do | ||
expect { subject }.to raise_error(/Unsupported platform:/) | ||
end | ||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,32 +7,32 @@ | |
let(:facts) { facts.merge({:fqdn => 'myhost.mydomain', :hostname => 'myhost'}) } | ||
|
||
it 'should remove Mysql_User[[email protected]]' do | ||
should contain_mysql_user('[email protected]').with_ensure('absent') | ||
is_expected.to contain_mysql_user('[email protected]').with_ensure('absent') | ||
end | ||
it 'should remove Mysql_User[root@myhost]' do | ||
should contain_mysql_user('root@myhost').with_ensure('absent') | ||
is_expected.to contain_mysql_user('root@myhost').with_ensure('absent') | ||
end | ||
it 'should remove Mysql_User[[email protected]]' do | ||
should contain_mysql_user('[email protected]').with_ensure('absent') | ||
is_expected.to contain_mysql_user('[email protected]').with_ensure('absent') | ||
end | ||
it 'should remove Mysql_User[root@::1]' do | ||
should contain_mysql_user('root@::1').with_ensure('absent') | ||
is_expected.to contain_mysql_user('root@::1').with_ensure('absent') | ||
end | ||
it 'should remove Mysql_User[@myhost.mydomain]' do | ||
should contain_mysql_user('@myhost.mydomain').with_ensure('absent') | ||
is_expected.to contain_mysql_user('@myhost.mydomain').with_ensure('absent') | ||
end | ||
it 'should remove Mysql_User[@myhost]' do | ||
should contain_mysql_user('@myhost').with_ensure('absent') | ||
is_expected.to contain_mysql_user('@myhost').with_ensure('absent') | ||
end | ||
it 'should remove Mysql_User[@localhost]' do | ||
should contain_mysql_user('@localhost').with_ensure('absent') | ||
is_expected.to contain_mysql_user('@localhost').with_ensure('absent') | ||
end | ||
it 'should remove Mysql_User[@%]' do | ||
should contain_mysql_user('@%').with_ensure('absent') | ||
is_expected.to contain_mysql_user('@%').with_ensure('absent') | ||
end | ||
|
||
it 'should remove Mysql_database[test]' do | ||
should contain_mysql_database('test').with_ensure('absent') | ||
is_expected.to contain_mysql_database('test').with_ensure('absent') | ||
end | ||
end | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.