Try to avoid reserved site keyword
[mirror/dsa-puppet.git] / 3rdparty / modules / postgresql / spec / unit / classes / server / plpython_spec.rb
1 require 'spec_helper'
2
3 describe 'postgresql::server::plpython', :type => :class do
4   let :facts do
5     {
6       :osfamily => 'RedHat',
7       :operatingsystem => 'CentOS',
8       :operatingsystemrelease => '6.0',
9       :concat_basedir => tmpfilename('plpython'),
10       :kernel => 'Linux',
11       :id => 'root',
12       :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
13       :selinux => true,
14     }
15   end
16
17   let :pre_condition do
18     "class { 'postgresql::server': }"
19   end
20
21   describe 'on RedHat with no parameters' do
22     it { is_expected.to contain_class("postgresql::server::plpython") }
23     it 'should create package' do
24       is_expected.to contain_package('postgresql-plpython').with({
25         :ensure => 'present',
26         :tag => 'postgresql',
27       })
28     end
29   end
30   
31   describe 'with parameters' do
32       let :params do
33         {
34           :package_ensure => 'absent',
35           :package_name => 'mypackage',
36         }
37       end
38   
39       it { is_expected.to contain_class("postgresql::server::plpython") }
40       it 'should create package with correct params' do
41         is_expected.to contain_package('postgresql-plpython').with({
42           :ensure => 'absent',
43           :name => 'mypackage',
44           :tag => 'postgresql',
45         })
46       end
47     end
48 end