module-puppetdb/spec/unit/classes/init_spec.rb
Ken Barber 603df7381d (GH-93) Switch to using puppetlabs-postgresql 3.x
This updates the module to be able to use puppetlabs-postgresql.

Since this change is a major change, it marks this patch as a breaking change.

I have prepared a suitable amount of upgrade notes for upgrading to this later
version of the module plus removed anything marked deprecated.

As cleanup, I've removed the troublesome 'tests' directory in favour of good
README.md documentation. I've also removed any puppet docs from each module
until such times as puppet docs become automated through the forge. This is
just to avoid contributors having to double their efforts - the README.md
is the authority now.

Signed-off-by: Ken Barber <ken@bob.sh>
2013-10-21 18:43:41 +01:00

43 lines
1.1 KiB
Ruby

require 'spec_helper'
describe 'puppetdb', :type => :class do
ttl_args = ['node_ttl','node_purge_ttl','report_ttl']
context 'on a supported platform' do
let(:facts) do
{
:osfamily => 'Debian',
:operatingsystem => 'Debian',
:operatingsystemrelease => '6.0',
:kernel => 'Linux',
:concat_basedir => '/var/lib/puppet/concat',
}
end
describe 'when using default values for puppetdb class' do
it { should contain_class('puppetdb') }
end
end
context 'with invalid arguments on a supported platform' do
let(:facts) do
{
:osfamily => 'RedHat',
:operatingsystem => 'Debian',
:operatingsystemrelease => '6.0',
:kernel => 'Linux',
:concat_basedir => '/var/lib/puppet/concat',
}
end
ttl_args.each do |ttl_arg|
let(:params) do
{
ttl_arg => 'invalid_value'
}
end
it "when using a value that does not match the validation regex for #{ttl_arg} puppetdb class" do
expect { should contain_class('puppetdb') }.to raise_error(Puppet::Error)
end
end
end
end