summaryrefslogtreecommitdiffstats
path: root/spec/unit/parser/ast/astarray.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/unit/parser/ast/astarray.rb')
-rwxr-xr-xspec/unit/parser/ast/astarray.rb20
1 files changed, 10 insertions, 10 deletions
diff --git a/spec/unit/parser/ast/astarray.rb b/spec/unit/parser/ast/astarray.rb
index b3026fe1e..212c3fd14 100755
--- a/spec/unit/parser/ast/astarray.rb
+++ b/spec/unit/parser/ast/astarray.rb
@@ -11,14 +11,14 @@ describe Puppet::Parser::AST::ASTArray do
array = Puppet::Parser::AST::ASTArray.new :children => []
array.should respond_to(:[])
end
-
+
it "should evaluate all its children" do
item1 = stub "item1", :is_a? => true
item2 = stub "item2", :is_a? => true
item1.expects(:safeevaluate).with(@scope).returns(123)
item2.expects(:safeevaluate).with(@scope).returns(246)
-
+
operator = Puppet::Parser::AST::ASTArray.new :children => [item1,item2]
operator.evaluate(@scope)
end
@@ -29,9 +29,9 @@ describe Puppet::Parser::AST::ASTArray do
item2.stubs(:is_a?).with(Puppet::Parser::AST).returns(true)
item2.stubs(:instance_of?).with(Puppet::Parser::AST::ASTArray).returns(true)
item2.stubs(:each).yields(item1)
-
+
item1.expects(:safeevaluate).with(@scope).returns(123)
-
+
operator = Puppet::Parser::AST::ASTArray.new :children => [item2]
operator.evaluate(@scope).should == [123]
end
@@ -42,9 +42,9 @@ describe Puppet::Parser::AST::ASTArray do
item2.stubs(:is_a?).with(Puppet::Parser::AST).returns(true)
item2.stubs(:instance_of?).with(Puppet::Parser::AST::ASTArray).returns(true)
item2.stubs(:each).yields([item1])
-
+
item1.expects(:safeevaluate).with(@scope).returns(123)
-
+
operator = Puppet::Parser::AST::ASTArray.new :children => [item2]
operator.evaluate(@scope).should == [123]
end
@@ -55,12 +55,12 @@ describe Puppet::Parser::AST::ASTArray do
item2.stubs(:is_a?).with(Puppet::Parser::AST).returns(true)
item2.stubs(:instance_of?).with(Puppet::Parser::AST::ASTArray).returns(true)
item2.stubs(:each).yields([item1])
-
+
item1.expects(:safeevaluate).with(@scope).returns([123])
-
+
operator = Puppet::Parser::AST::ASTArray.new :children => [item2]
operator.evaluate(@scope).should == [[123]]
end
-
-
+
+
end