diff options
Diffstat (limited to 'spec/unit/parser/interpreter.rb')
-rwxr-xr-x | spec/unit/parser/interpreter.rb | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/spec/unit/parser/interpreter.rb b/spec/unit/parser/interpreter.rb index 27cf7056d..211f42df0 100755 --- a/spec/unit/parser/interpreter.rb +++ b/spec/unit/parser/interpreter.rb @@ -112,7 +112,8 @@ describe Puppet::Parser::Interpreter do end it "should create a compile with the node and parser" do - @compiler.expects(:compile).returns(:config) + catalog = stub 'catalog', :to_resource => nil + @compiler.expects(:compile).returns(catalog) @interp.expects(:parser).with(:myenv).returns(@parser) Puppet::Parser::Compiler.expects(:new).with(@node, @parser).returns(@compiler) @interp.compile(@node) @@ -123,6 +124,16 @@ describe Puppet::Parser::Interpreter do @interp.expects(:parser).with(:myenv).returns(nil) proc { @interp.compile(@node) }.should raise_error(Puppet::ParseError) end + + it "should return the results of the compile, converted to a plain resource catalog" do + catalog = mock 'catalog' + @compiler.expects(:compile).returns(catalog) + @interp.stubs(:parser).returns(@parser) + Puppet::Parser::Compiler.stubs(:new).returns(@compiler) + + catalog.expects(:to_resource).returns "my_resource_catalog" + @interp.compile(@node).should == "my_resource_catalog" + end end describe "when returning catalog version" do |