diff options
| author | Luke Kanies <luke@madstop.com> | 2009-01-23 18:49:26 -0600 |
|---|---|---|
| committer | Luke Kanies <luke@madstop.com> | 2009-02-06 18:08:42 -0600 |
| commit | d53ad3181d3f5953b00512d7793945d238d1879f (patch) | |
| tree | f23104eada8d7baa2b82238124755ca90ebd8a78 /spec/unit/parser | |
| parent | f38277fb7d044394665db369892c01162b866863 (diff) | |
Converting the catalog as needed
Converting to a Resource catalog for transmission,
then converting to a RAL catalog on the client.
Signed-off-by: Luke Kanies <luke@madstop.com>
Diffstat (limited to 'spec/unit/parser')
| -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 |
