From 29f09e2181a56ec801b39e56bd28119709495dd9 Mon Sep 17 00:00:00 2001 From: David Schmitt Date: Wed, 15 Apr 2015 16:46:09 -0700 Subject: spec_helper: set parser config if requested --- spec/lib/puppet_spec/compiler.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'spec/lib/puppet_spec/compiler.rb') diff --git a/spec/lib/puppet_spec/compiler.rb b/spec/lib/puppet_spec/compiler.rb index 2f0ae4d..1f322ca 100755 --- a/spec/lib/puppet_spec/compiler.rb +++ b/spec/lib/puppet_spec/compiler.rb @@ -2,6 +2,7 @@ module PuppetSpec::Compiler def compile_to_catalog(string, node = Puppet::Node.new('foonode')) Puppet[:code] = string + Puppet[:parser] = 'future' if ENV['FUTURE_PARSER'] == 'yes' Puppet::Parser::Compiler.compile(node) end -- cgit v1.2.3 From 18d4c21418e8d188ae659a92ff3a8df04d711f6a Mon Sep 17 00:00:00 2001 From: David Schmitt Date: Mon, 1 Jun 2015 12:21:59 +0100 Subject: Remove unused puppet_spec code This is copied and changed code from an older version of puppet's internal test setup code. It does not work with puppet4. --- spec/lib/puppet_spec/compiler.rb | 48 ---------------------------------------- 1 file changed, 48 deletions(-) delete mode 100755 spec/lib/puppet_spec/compiler.rb (limited to 'spec/lib/puppet_spec/compiler.rb') diff --git a/spec/lib/puppet_spec/compiler.rb b/spec/lib/puppet_spec/compiler.rb deleted file mode 100755 index 1f322ca..0000000 --- a/spec/lib/puppet_spec/compiler.rb +++ /dev/null @@ -1,48 +0,0 @@ -#! /usr/bin/env ruby -S rspec -module PuppetSpec::Compiler - def compile_to_catalog(string, node = Puppet::Node.new('foonode')) - Puppet[:code] = string - Puppet[:parser] = 'future' if ENV['FUTURE_PARSER'] == 'yes' - Puppet::Parser::Compiler.compile(node) - end - - def compile_to_ral(manifest) - catalog = compile_to_catalog(manifest) - ral = catalog.to_ral - ral.finalize - ral - end - - def compile_to_relationship_graph(manifest, prioritizer = Puppet::Graph::SequentialPrioritizer.new) - ral = compile_to_ral(manifest) - graph = Puppet::Graph::RelationshipGraph.new(prioritizer) - graph.populate_from(ral) - graph - end - - if Puppet.version.to_f >= 3.3 - def apply_compiled_manifest(manifest, prioritizer = Puppet::Graph::SequentialPrioritizer.new) - transaction = Puppet::Transaction.new(compile_to_ral(manifest), - Puppet::Transaction::Report.new("apply"), - prioritizer) - transaction.evaluate - transaction.report.finalize_report - - transaction - end - else - def apply_compiled_manifest(manifest) - transaction = Puppet::Transaction.new(compile_to_ral(manifest), Puppet::Transaction::Report.new("apply")) - transaction.evaluate - transaction.report.finalize_report - - transaction - end - end - - def order_resources_traversed_in(relationships) - order_seen = [] - relationships.traverse { |resource| order_seen << resource.ref } - order_seen - end -end -- cgit v1.2.3