diff options
Diffstat (limited to 'spec/unit/parser/ast/casestatement.rb')
-rwxr-xr-x | spec/unit/parser/ast/casestatement.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/spec/unit/parser/ast/casestatement.rb b/spec/unit/parser/ast/casestatement.rb index c2e9a6929..240d3bfea 100755 --- a/spec/unit/parser/ast/casestatement.rb +++ b/spec/unit/parser/ast/casestatement.rb @@ -104,19 +104,21 @@ describe Puppet::Parser::AST::CaseStatement do end it "should unset scope ephemeral variables after option evaluation" do + @scope.stubs(:ephemeral_level).returns(:level) @opval1.stubs(:evaluate_match).with { |*arg| arg[0] == "value" and arg[1] == @scope }.returns(true) @option1.stubs(:safeevaluate).with(@scope).returns(:result) - @scope.expects(:unset_ephemeral_var) + @scope.expects(:unset_ephemeral_var).with(:level) @casestmt.evaluate(@scope) end it "should not leak ephemeral variables even if evaluation fails" do + @scope.stubs(:ephemeral_level).returns(:level) @opval1.stubs(:evaluate_match).with { |*arg| arg[0] == "value" and arg[1] == @scope }.returns(true) @option1.stubs(:safeevaluate).with(@scope).raises - @scope.expects(:unset_ephemeral_var) + @scope.expects(:unset_ephemeral_var).with(:level) lambda { @casestmt.evaluate(@scope) }.should raise_error end |