mirror of
https://github.com/inspec/inspec
synced 2024-12-04 18:39:43 +00:00
28 lines
998 B
Ruby
28 lines
998 B
Ruby
|
# encoding: utf-8
|
||
|
# author: Aaron Lippold, lippold@gmail.com
|
||
|
# author: Rony Xavier, rx294@nyu.edu
|
||
|
|
||
|
require 'helper'
|
||
|
require 'inspec/resource'
|
||
|
|
||
|
describe 'Inspec::Resources::PGIdentConf' do
|
||
|
describe 'PGIdentConf Paramaters' do
|
||
|
resource = load_resource('postgres_ident_conf')
|
||
|
it 'Verify postgres_ident_conf filtering by `system_username`' do
|
||
|
entries = resource.where { system_username == 'bryanh' }
|
||
|
_(entries.map_name).must_equal ['omicron']
|
||
|
_(entries.pg_username).must_equal ['bryanh']
|
||
|
end
|
||
|
it 'Verify postgres_ident_conf filtering by `map_name`' do
|
||
|
entries = resource.where { map_name == 'ssl-test' }
|
||
|
_(entries.system_username).must_equal ['ann']
|
||
|
_(entries.pg_username).must_equal ['ann']
|
||
|
end
|
||
|
it 'Verify postgres_ident_conf filtering by `pg_username`' do
|
||
|
entries = resource.where { pg_username == 'bob' }
|
||
|
_(entries.map_name).must_equal ['pki-users']
|
||
|
_(entries.system_username).must_equal ['robert']
|
||
|
end
|
||
|
end
|
||
|
end
|