module-puppetlabs-mysql/spec/classes/mysql_bindings_perl_spec.rb

61 lines
1.4 KiB
Ruby
Raw Normal View History

2013-05-03 18:09:59 +02:00
require 'spec_helper'
describe 'mysql::bindings::perl' do
2013-05-03 18:09:59 +02:00
describe 'on a debian based os' do
let :facts do
2013-07-08 11:49:30 +02:00
{ :osfamily => 'Debian', :root_home => '/root'}
2013-05-03 18:09:59 +02:00
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
2013-07-08 11:49:30 +02:00
{ :osfamily => 'FreeBSD', :root_home => '/root'}
2013-05-03 18:09:59 +02:00
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
2013-07-08 11:49:30 +02:00
{:osfamily => 'Redhat', :root_home => '/root'}
2013-05-03 18:09:59 +02:00
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
2013-07-08 11:49:30 +02:00
{:osfamily => 'foo', :root_home => '/root'}
2013-05-03 18:09:59 +02:00
end
it 'should fail' do
expect { subject }.to raise_error(/Unsupported osfamily: foo/)
end
end
end