aboutsummaryrefslogtreecommitdiff
path: root/spec/lib
diff options
context:
space:
mode:
authorMelissa <melissa@puppet.com>2018-07-02 11:45:02 -0700
committerGitHub <noreply@github.com>2018-07-02 11:45:02 -0700
commitc42bbe6471b9f1813d7b40b9f67d988b994a8e5a (patch)
treefa26c6a5cd53626ac3cddc4922c47add356c6435 /spec/lib
parentd1719de1d77b9c139b1b5f5832330807c0fe11fe (diff)
parent950a6c0a21896989118badc0f541f7469752c63f (diff)
downloadpuppet-sshkeys_core-c42bbe6471b9f1813d7b40b9f67d988b994a8e5a.tar.gz
puppet-sshkeys_core-c42bbe6471b9f1813d7b40b9f67d988b994a8e5a.tar.bz2
Merge pull request #1 from jhelwig/module-updates
Import the module
Diffstat (limited to 'spec/lib')
-rw-r--r--spec/lib/puppet_spec/compiler.rb12
1 files changed, 6 insertions, 6 deletions
diff --git a/spec/lib/puppet_spec/compiler.rb b/spec/lib/puppet_spec/compiler.rb
index 8964a26..49a6534 100644
--- a/spec/lib/puppet_spec/compiler.rb
+++ b/spec/lib/puppet_spec/compiler.rb
@@ -34,8 +34,8 @@ module PuppetSpec::Compiler
catalog.resources.each { |res| yield res }
end
transaction = Puppet::Transaction.new(catalog,
- Puppet::Transaction::Report.new,
- prioritizer)
+ Puppet::Transaction::Report.new,
+ prioritizer)
transaction.evaluate
transaction.report.finalize_report
@@ -70,7 +70,7 @@ module PuppetSpec::Compiler
collect_notices(code, node) do |compiler|
unless topscope_vars.empty?
scope = compiler.topscope
- topscope_vars.each {|k,v| scope.setvar(k, v) }
+ topscope_vars.each { |k, v| scope.setvar(k, v) }
end
if block_given?
compiler.compile do |catalog|
@@ -90,12 +90,12 @@ module PuppetSpec::Compiler
# (Parameters given by name)
#
def evaluate(code: 'undef', source: nil, node: Puppet::Node.new('testnode'), variables: {})
- source_location = caller[0]
+ source_location = caller(0..0).first
Puppet[:code] = code
compiler = Puppet::Parser::Compiler.new(node)
unless variables.empty?
scope = compiler.topscope
- variables.each {|k,v| scope.setvar(k, v) }
+ variables.each { |k, v| scope.setvar(k, v) }
end
if source.nil?
@@ -105,7 +105,7 @@ module PuppetSpec::Compiler
end
# evaluate given source is the context of the compiled state and return its result
- compiler.compile do |catalog |
+ compiler.compile do |_catalog|
Puppet::Pops::Parser::EvaluatingParser.singleton.evaluate_string(compiler.topscope, source, source_location)
end
end