-
Notifications
You must be signed in to change notification settings - Fork 613
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1530 from puppetlabs/fix-postgresql_default
Fix `postgresql::default()` return value for unknown parameters
- Loading branch information
Showing
2 changed files
with
37 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'spec_helper' | ||
|
||
describe 'postgresql::default' do | ||
let(:facts) do | ||
{ | ||
'os' => { | ||
'family' => 'Debian', | ||
'name' => 'Debian', | ||
'release' => { | ||
'full' => '11.7', | ||
'major' => '11', | ||
'minor' => '7', | ||
} | ||
} | ||
} | ||
end | ||
|
||
let(:pre_condition) do | ||
<<~PP | ||
class { 'postgresql::server': | ||
} | ||
PP | ||
end | ||
|
||
# parameter in params.pp only | ||
it { is_expected.to run.with_params('port').and_return(5432) } | ||
|
||
# parameter in globals.pp only | ||
it { is_expected.to run.with_params('default_connect_settings').and_return({}) } | ||
|
||
it { is_expected.to run.with_params('a_parameter_that_does_not_exist').and_raise_error(Puppet::ParseError, %r{pick\(\): must receive at least one non empty value}) } | ||
end |