diff options
| author | Luke Kanies <luke@madstop.com> | 2007-09-06 19:24:25 -0500 |
|---|---|---|
| committer | Luke Kanies <luke@madstop.com> | 2007-09-06 19:24:25 -0500 |
| commit | 4104bd3ee9fa146b49aa446fbf4cc3edcdf0974d (patch) | |
| tree | dfa1a147f8949c4fd09484979714397c4248f666 /spec/unit/parser | |
| parent | b7f42441b91c921cd31f3d8c7875ce98bdedf786 (diff) | |
| download | puppet-4104bd3ee9fa146b49aa446fbf4cc3edcdf0974d.tar.gz puppet-4104bd3ee9fa146b49aa446fbf4cc3edcdf0974d.tar.xz puppet-4104bd3ee9fa146b49aa446fbf4cc3edcdf0974d.zip | |
Fixing #807. The exception handling should more closely resemble how it used to be done.
Diffstat (limited to 'spec/unit/parser')
| -rwxr-xr-x | spec/unit/parser/interpreter.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/spec/unit/parser/interpreter.rb b/spec/unit/parser/interpreter.rb index ebb7d4cbf..c0f9d54b3 100755 --- a/spec/unit/parser/interpreter.rb +++ b/spec/unit/parser/interpreter.rb @@ -67,7 +67,7 @@ describe Puppet::Parser::Interpreter, " when creating parser instances" do it "should return nothing when new parsers fail" do Puppet::Parser::Parser.expects(:new).with(:environment => :myenv).raises(ArgumentError) - @interp.send(:create_parser, :myenv).should be_nil + proc { @interp.send(:create_parser, :myenv) }.should raise_error(Puppet::Error) end it "should create parsers with environment-appropriate manifests" do @@ -83,11 +83,13 @@ describe Puppet::Parser::Interpreter, " when creating parser instances" do parser1 = mock 'parser1' Puppet::Parser::Parser.expects(:new).with(:environment => :env1).returns(parser1) parser1.expects(:file=).with("/t/env1.pp") + parser1.expects(:parse) @interp.send(:create_parser, :env1) parser2 = mock 'parser2' Puppet::Parser::Parser.expects(:new).with(:environment => :env2).returns(parser2) parser2.expects(:file=).with("/t/env2.pp") + parser2.expects(:parse) @interp.send(:create_parser, :env2) end end @@ -100,7 +102,7 @@ describe Puppet::Parser::Interpreter, " when managing parser instances" do it "it should an exception when nothing is there and nil is returned" do @interp.expects(:create_parser).with(:myenv).returns(nil) - lambda { @interp.send(:parser, :myenv) }.should raise_error(Puppet::Error) + @interp.send(:parser, :myenv).should be_nil end it "should create and return a new parser and use the same parser when the parser does not need reparsing" do |
