diff options
Diffstat (limited to 'spec/unit/parser/compile.rb')
-rwxr-xr-x | spec/unit/parser/compile.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/unit/parser/compile.rb b/spec/unit/parser/compile.rb index f6b3c9b3f..8bfcdd495 100755 --- a/spec/unit/parser/compile.rb +++ b/spec/unit/parser/compile.rb @@ -49,4 +49,14 @@ describe Puppet::Parser::Compile, " when compiling" do @compile.resources.find { |r| r.to_s == "Class[two]" }.should be_nil @compile.resources.find { |r| r.to_s == "Class[four]" }.should be_nil end + + it "should enable ast_nodes if the parser has any nodes" do + @parser.expects(:nodes).returns(:one => :yay) + @compile.ast_nodes?.should be_true + end + + it "should disable ast_nodes if the parser has no nodes" do + @parser.expects(:nodes).returns({}) + @compile.ast_nodes?.should be_false + end end |