summaryrefslogtreecommitdiffstats
path: root/spec/unit/parser/ast/selector.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/unit/parser/ast/selector.rb')
-rwxr-xr-xspec/unit/parser/ast/selector.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/spec/unit/parser/ast/selector.rb b/spec/unit/parser/ast/selector.rb
index f9a1efe6c..85092fe6e 100755
--- a/spec/unit/parser/ast/selector.rb
+++ b/spec/unit/parser/ast/selector.rb
@@ -118,19 +118,21 @@ describe Puppet::Parser::AST::Selector do
end
it "should unset scope ephemeral variables after option evaluation" do
+ @scope.stubs(:ephemeral_level).returns(:level)
@param1.stubs(:evaluate_match).with { |*arg| arg[0] == "value" and arg[1] == @scope }.returns(true)
@value1.stubs(:safeevaluate).with(@scope).returns(:result)
- @scope.expects(:unset_ephemeral_var)
+ @scope.expects(:unset_ephemeral_var).with(:level)
@selector.evaluate(@scope)
end
it "should not leak ephemeral variables even if evaluation fails" do
+ @scope.stubs(:ephemeral_level).returns(:level)
@param1.stubs(:evaluate_match).with { |*arg| arg[0] == "value" and arg[1] == @scope }.returns(true)
@value1.stubs(:safeevaluate).with(@scope).raises
- @scope.expects(:unset_ephemeral_var)
+ @scope.expects(:unset_ephemeral_var).with(:level)
lambda { @selector.evaluate(@scope) }.should raise_error
end