diff options
author | Daniel Pittman <daniel@puppetlabs.com> | 2012-07-15 14:09:36 -0700 |
---|---|---|
committer | Daniel Pittman <daniel@puppetlabs.com> | 2012-07-15 15:21:31 -0700 |
commit | 574b21921c528df8ba95af3a60a3632cbb9e00d1 (patch) | |
tree | 655b7d62e8d46178c9ded0883d1b91ec2d90c6f0 /spec/unit/parser/ast/resource_reference_spec.rb | |
parent | bea5c78e1a7d9797e1da42a65f1a971378fefa91 (diff) | |
download | puppet-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/ast/resource_reference_spec.rb')
-rwxr-xr-x | spec/unit/parser/ast/resource_reference_spec.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/spec/unit/parser/ast/resource_reference_spec.rb b/spec/unit/parser/ast/resource_reference_spec.rb index d7f4ba503..174c8aef5 100755 --- a/spec/unit/parser/ast/resource_reference_spec.rb +++ b/spec/unit/parser/ast/resource_reference_spec.rb @@ -6,7 +6,9 @@ describe Puppet::Parser::AST::ResourceReference do ast = Puppet::Parser::AST 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) end def ast_name(value) |