2012-04-24 06:44:31 +02:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe 'mysql::java' do
|
|
|
|
|
|
|
|
describe 'on a debian based os' do
|
|
|
|
let :facts do
|
|
|
|
{ :osfamily => 'Debian'}
|
|
|
|
end
|
|
|
|
it { should contain_package('mysql-connector-java').with(
|
|
|
|
:name => 'libmysql-java',
|
|
|
|
: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-connector-java').with(
|
|
|
|
:name => 'databases/mysql-connector-java',
|
|
|
|
:ensure => 'present'
|
|
|
|
)}
|
|
|
|
end
|
|
|
|
|
2012-04-24 06:44:31 +02:00
|
|
|
describe 'on a redhat based os' do
|
|
|
|
let :facts do
|
|
|
|
{:osfamily => 'Redhat'}
|
|
|
|
end
|
|
|
|
it { should contain_package('mysql-connector-java').with(
|
|
|
|
:name => 'mysql-connector-java',
|
|
|
|
:ensure => 'present'
|
|
|
|
)}
|
|
|
|
describe 'when parameters are supplied' do
|
|
|
|
let :params do
|
|
|
|
{:package_ensure => 'latest', :package_name => 'java-mysql'}
|
|
|
|
end
|
|
|
|
it { should contain_package('mysql-connector-java').with(
|
|
|
|
:name => 'java-mysql',
|
|
|
|
: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-04-24 06:44:31 +02:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|