module-puppetdb/spec/unit/classes/init_spec.rb
Andrew Roetker 8eb9f67669 (PDB-1657) Manage Postgres repos by default
This commit moves to managing the Postgres repos by default. The
reason for this is so that the `puppetdb` class will "just work" by
default on most systems, because PostgreSQL 9.4 is not installed on 6/7
of the distros we support we need to manage the repos so we can install
the latest version.
2015-06-24 16:01:42 -07:00

47 lines
1.3 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',
:lsbdistid => 'Debian',
:lsbdistcodename => 'foo',
:id => 'root',
:path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
}
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