7c7195ba33
The current MySQL module is hard to modify, test, and drop in replacement components to. This work starts out by refactoring the bindings support in MySQL to a completely seperate bindings class in order to reduce the amount of parameters in the main class for a feature that is infrequently used. In addition to this start the movement of client configuration and packages to the mysql::client::* namespace.
60 lines
1.4 KiB
Ruby
60 lines
1.4 KiB
Ruby
require 'spec_helper'
|
|
|
|
describe 'mysql::bindings::perl' do
|
|
|
|
describe 'on a debian based os' do
|
|
let :facts do
|
|
{ :osfamily => 'Debian', :root_home => '/root'}
|
|
end
|
|
it { should contain_package('perl_mysql').with(
|
|
:name => 'libdbd-mysql-perl',
|
|
:ensure => 'present',
|
|
:provider => ''
|
|
)}
|
|
end
|
|
|
|
describe 'on a freebsd based os' do
|
|
let :facts do
|
|
{ :osfamily => 'FreeBSD', :root_home => '/root'}
|
|
end
|
|
it { should contain_package('perl_mysql').with(
|
|
:name => 'p5-DBD-mysql',
|
|
:ensure => 'present',
|
|
:provider => ''
|
|
)}
|
|
end
|
|
|
|
describe 'on a redhat based os' do
|
|
let :facts do
|
|
{:osfamily => 'Redhat', :root_home => '/root'}
|
|
end
|
|
it { should contain_package('perl_mysql').with(
|
|
:name => 'perl-DBD-MySQL',
|
|
:ensure => 'present',
|
|
:provider => ''
|
|
)}
|
|
describe 'when parameters are supplied' do
|
|
let :params do
|
|
{:package_ensure => 'latest',
|
|
:package_provider => 'zypper',
|
|
:package_name => 'mysql_perl'}
|
|
end
|
|
it { should contain_package('perl_mysql').with(
|
|
:name => 'mysql_perl',
|
|
:ensure => 'latest',
|
|
:provider => 'zypper'
|
|
)}
|
|
end
|
|
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 osfamily: foo/)
|
|
end
|
|
end
|
|
|
|
end
|