From 15696869bc4b62b47b5e6b873694635b2dc86c0d Mon Sep 17 00:00:00 2001 From: Josh Cooper Date: Tue, 27 Nov 2018 16:49:54 -0800 Subject: Account for pre-5 behavior In Puppet4, the Report class requires a kind argument. Also the is_to_s and should_to_s methods returned an array of strings and a flattened array as a string. That behavior was changed in PUP-7616 (commit c14b28f9c427) so that both methods return a string as the name implies. --- spec/lib/puppet_spec/compiler.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'spec/lib/puppet_spec') diff --git a/spec/lib/puppet_spec/compiler.rb b/spec/lib/puppet_spec/compiler.rb index 49a6534..4170b31 100644 --- a/spec/lib/puppet_spec/compiler.rb +++ b/spec/lib/puppet_spec/compiler.rb @@ -29,12 +29,16 @@ module PuppetSpec::Compiler end def apply_compiled_manifest(manifest, prioritizer = Puppet::Graph::SequentialPrioritizer.new) + args = [] + if Puppet.version.to_f < 5.0 + args << 'apply' + end catalog = compile_to_ral(manifest) if block_given? catalog.resources.each { |res| yield res } end transaction = Puppet::Transaction.new(catalog, - Puppet::Transaction::Report.new, + Puppet::Transaction::Report.new(*args), prioritizer) transaction.evaluate transaction.report.finalize_report -- cgit v1.2.3