summaryrefslogtreecommitdiff
path: root/spec/lib/puppet_spec/compiler.rb
diff options
context:
space:
mode:
authorDavid Schmitt <david.schmitt@puppetlabs.com>2015-06-01 12:21:59 +0100
committerDavid Schmitt <david.schmitt@puppetlabs.com>2015-06-01 18:02:22 +0100
commit18d4c21418e8d188ae659a92ff3a8df04d711f6a (patch)
treef044a3b9c65db499ae279a08328c18200201d094 /spec/lib/puppet_spec/compiler.rb
parentf3e79ddcd56a221c7799b35efde7e9803a5c7923 (diff)
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.
Diffstat (limited to 'spec/lib/puppet_spec/compiler.rb')
-rwxr-xr-xspec/lib/puppet_spec/compiler.rb48
1 files changed, 0 insertions, 48 deletions
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