Skip to content

Commit a59b798

Browse files
committed
(GH-2338) Rename 'sensitive' plan in tests
'Sensitive' is a reserved word in Puppet 7 and cannot be used as a plan name. We have a plan named 'sensitive' used for testing the `run_plan` plan function. This renames the test fixture to 'sensitive_test'. !no-release-note
1 parent 5218c66 commit a59b798

4 files changed

Lines changed: 18 additions & 15 deletions

File tree

bolt-modules/boltlib/spec/fixtures/modules/sensitive/plans/complex.pp renamed to bolt-modules/boltlib/spec/fixtures/modules/sensitive_test/plans/complex.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
plan sensitive::complex (
1+
plan sensitive_test::complex (
22
Variant[Sensitive[String], Array[String]] $complex
33
) {
44
}

bolt-modules/boltlib/spec/fixtures/modules/sensitive/plans/init.pp renamed to bolt-modules/boltlib/spec/fixtures/modules/sensitive_test/plans/init.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
plan sensitive (
1+
plan sensitive_test (
22
Sensitive $array,
33
Sensitive $hash,
44
Sensitive $string

bolt-modules/boltlib/spec/fixtures/modules/sensitive/plans/no_api.pp renamed to bolt-modules/boltlib/spec/fixtures/modules/sensitive_test/plans/no_api.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
plan sensitive::no_api (
1+
plan sensitive_test::no_api (
22
Sensitive[String] $string
33
) {
44
}

bolt-modules/boltlib/spec/functions/run_plan_spec.rb

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -171,28 +171,31 @@
171171
sensitive.expects(:new).with(input_params['string'])
172172
.returns(expected_params['string'])
173173

174-
is_expected.to run.with_params('sensitive', input_params.merge('_bolt_api_call' => true))
175-
.and_return(input_params)
174+
is_expected.to run
175+
.with_params('sensitive_test', input_params.merge('_bolt_api_call' => true))
176+
.and_return(input_params)
176177
end
177178

178179
it 'parameters are not wrapped from non-API calls' do
179180
sensitive.expects(:new).never
180181

181-
is_expected.to run.with_params('sensitive::no_api', 'string' => string)
182-
.and_raise_error(
183-
Puppet::ParseError,
184-
/parameter 'string' expects a Sensitive\[String\]/
185-
)
182+
is_expected.to run
183+
.with_params('sensitive_test::no_api', 'string' => string)
184+
.and_raise_error(
185+
Puppet::ParseError,
186+
/parameter 'string' expects a Sensitive\[String\]/
187+
)
186188
end
187189

188190
it 'complex parameters using Sensitive are not wrapped' do
189191
sensitive.expects(:new).never
190192

191-
is_expected.to run.with_params('sensitive::complex', 'complex' => string)
192-
.and_raise_error(
193-
Puppet::ParseError,
194-
/parameter 'complex' expects a value of type Sensitive\[String\] or Array/
195-
)
193+
is_expected.to run
194+
.with_params('sensitive_test::complex', 'complex' => string)
195+
.and_raise_error(
196+
Puppet::ParseError,
197+
/parameter 'complex' expects a value of type Sensitive\[String\] or Array/
198+
)
196199
end
197200
end
198201
end

0 commit comments

Comments
 (0)