X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=3rdparty%2Fmodules%2Fpostgresql%2Fspec%2Funit%2Fdefines%2Fpg_hba_rule_spec.rb;fp=3rdparty%2Fmodules%2Fpostgresql%2Fspec%2Funit%2Fdefines%2Fpg_hba_rule_spec.rb;h=0000000000000000000000000000000000000000;hb=a69999e580f8b3abd12446c2d6ad59e517651813;hp=1a3921338b8c11f6d2cf04820c1f2a72d7c80fd6;hpb=e7b6b352165009c385c52fcfe5a1055690dbfa4b;p=mirror%2Fdsa-puppet.git diff --git a/3rdparty/modules/postgresql/spec/unit/defines/pg_hba_rule_spec.rb b/3rdparty/modules/postgresql/spec/unit/defines/pg_hba_rule_spec.rb deleted file mode 100644 index 1a3921338..000000000 --- a/3rdparty/modules/postgresql/spec/unit/defines/pg_hba_rule_spec.rb +++ /dev/null @@ -1,104 +0,0 @@ -require 'spec_helper' - -describe 'postgresql::pg_hba_rule', :type => :define do - let :facts do - { - :postgres_default_version => '8.4', - :osfamily => 'Debian', - :concat_basedir => tmpfilename('pg_hba'), - } - end - let :title do - 'test' - end - let :target do - tmpfilename('pg_hba_rule') - end - - context 'test template 1' do - let :params do - { - :type => 'host', - :database => 'all', - :user => 'all', - :address => '1.1.1.1/24', - :auth_method => 'md5', - :target => target, - } - end - it do - content = param('concat::fragment', 'pg_hba_rule_test', 'content') - content.should =~ /host\s+all\s+all\s+1\.1\.1\.1\/24\s+md5/ - end - end - - context 'test template 2' do - let :params do - { - :type => 'local', - :database => 'all', - :user => 'all', - :auth_method => 'ident', - :target => target, - } - end - it do - content = param('concat::fragment', 'pg_hba_rule_test', 'content') - content.should =~ /local\s+all\s+all\s+ident/ - end - end - - context 'test template 3' do - let :params do - { - :type => 'host', - :database => 'all', - :user => 'all', - :address => '0.0.0.0/0', - :auth_method => 'ldap', - :auth_option => 'foo=bar', - :target => target, - } - end - it do - content = param('concat::fragment', 'pg_hba_rule_test', 'content') - content.should =~ /host\s+all\s+all\s+0\.0\.0\.0\/0\s+ldap\s+foo=bar/ - end - end - - context 'validation' do - context 'validate type test 1' do - let :params do - { - :type => 'invalid', - :database => 'all', - :user => 'all', - :address => '0.0.0.0/0', - :auth_method => 'ldap', - :target => target, - } - end - it 'should fail parsing when type is not valid' do - expect {subject}.to raise_error(Puppet::Error, - /The type you specified \[invalid\] must be one of/) - end - end - - context 'validate auth_method' do - let :params do - { - :type => 'local', - :database => 'all', - :user => 'all', - :address => '0.0.0.0/0', - :auth_method => 'invalid', - :target => target, - } - end - it 'should fail parsing when auth_method is not valid' do - expect {subject}.to raise_error(Puppet::Error, - /The auth_method you specified \[invalid\] must be one of/) - end - end - end -end