summaryrefslogtreecommitdiff
path: root/spec/unit/parser/functions/fqdn_rand_spec.rb
diff options
context:
space:
mode:
authorDaniel Pittman <daniel@puppetlabs.com>2012-07-15 14:09:36 -0700
committerDaniel Pittman <daniel@puppetlabs.com>2012-07-15 15:21:31 -0700
commit574b21921c528df8ba95af3a60a3632cbb9e00d1 (patch)
tree655b7d62e8d46178c9ded0883d1b91ec2d90c6f0 /spec/unit/parser/functions/fqdn_rand_spec.rb
parentbea5c78e1a7d9797e1da42a65f1a971378fefa91 (diff)
downloadpuppet-574b21921c528df8ba95af3a60a3632cbb9e00d1.tar.gz
A scope always has a compiler.
The scope object contained some internal code to substitute an external environment when the compiler was not supplied. This was used only in testing, not in any production capacity. In light of that, we can eliminate the dynamic decision making inside the scope and simply demand that a compiler instance (or a fake equivalent) is always supplied. This reduces the complexity of the code and makes clearer the object relationships involved. (The small cost is a lot of testing that depended on this had to change to use a real compiler. Most of the change derives from that.) Signed-off-by: Daniel Pittman <daniel@puppetlabs.com>
Diffstat (limited to 'spec/unit/parser/functions/fqdn_rand_spec.rb')
-rwxr-xr-xspec/unit/parser/functions/fqdn_rand_spec.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/spec/unit/parser/functions/fqdn_rand_spec.rb b/spec/unit/parser/functions/fqdn_rand_spec.rb
index a6b0d6b29..d7e8bd106 100755
--- a/spec/unit/parser/functions/fqdn_rand_spec.rb
+++ b/spec/unit/parser/functions/fqdn_rand_spec.rb
@@ -7,7 +7,9 @@ describe "the fqdn_rand function" do
end
before :each do
- @scope = Puppet::Parser::Scope.new
+ node = Puppet::Node.new('localhost')
+ compiler = Puppet::Parser::Compiler.new(node)
+ @scope = Puppet::Parser::Scope.new(:compiler => compiler)
@scope[:fqdn] = "127.0.0.1"
end