2011-12-19 16:25:35 +01:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe 'mysql' do
|
2012-03-16 18:36:12 +01:00
|
|
|
|
|
|
|
describe 'on a debian based os' do
|
|
|
|
let :facts do
|
|
|
|
{ :osfamily => 'Debian'}
|
|
|
|
end
|
|
|
|
it { should contain_package('mysql_client').with(
|
|
|
|
:name => 'mysql-client',
|
|
|
|
:ensure => 'present'
|
|
|
|
)}
|
|
|
|
end
|
|
|
|
|
2012-05-10 06:55:16 +02:00
|
|
|
describe 'on a freebsd based os' do
|
|
|
|
let :facts do
|
|
|
|
{ :osfamily => 'FreeBSD'}
|
|
|
|
end
|
|
|
|
it { should contain_package('mysql_client').with(
|
|
|
|
:name => 'databases/mysql55-client',
|
|
|
|
:ensure => 'present'
|
|
|
|
)}
|
|
|
|
end
|
|
|
|
|
2012-03-16 18:36:12 +01:00
|
|
|
describe 'on a redhat based os' do
|
|
|
|
let :facts do
|
|
|
|
{:osfamily => 'Redhat'}
|
|
|
|
end
|
|
|
|
it { should contain_package('mysql_client').with(
|
|
|
|
:name => 'mysql',
|
|
|
|
:ensure => 'present'
|
|
|
|
)}
|
|
|
|
describe 'when parameters are supplied' do
|
|
|
|
let :params do
|
|
|
|
{:package_ensure => 'latest', :package_name => 'mysql_client'}
|
|
|
|
end
|
|
|
|
it { should contain_package('mysql_client').with(
|
|
|
|
:name => 'mysql_client',
|
|
|
|
:ensure => 'latest'
|
|
|
|
)}
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
describe 'on any other os' do
|
|
|
|
let :facts do
|
|
|
|
{:osfamily => 'foo'}
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'should fail' do
|
2012-07-24 01:39:37 +02:00
|
|
|
expect { subject }.to raise_error(/Unsupported osfamily: foo/)
|
2012-03-16 18:36:12 +01:00
|
|
|
end
|
2012-02-09 20:26:00 +01:00
|
|
|
end
|
2011-12-19 16:25:35 +01:00
|
|
|
|
|
|
|
end
|