diff options
author | Luke Kanies <luke@madstop.com> | 2008-06-14 21:32:10 -0500 |
---|---|---|
committer | Luke Kanies <luke@madstop.com> | 2008-06-14 21:32:10 -0500 |
commit | 7b10c39bdc20cad3d4652008c404d576461d75e1 (patch) | |
tree | dcc2be944f00b40ad213ba254c712f2677522391 /spec/unit/parser | |
parent | 6a61198f9293674a4bf0aa75bfbca10e20f64d20 (diff) | |
parent | 575f37a0656f5a1f94fe6fb1b189d1701a98cadc (diff) | |
download | puppet-7b10c39bdc20cad3d4652008c404d576461d75e1.tar.gz puppet-7b10c39bdc20cad3d4652008c404d576461d75e1.tar.xz puppet-7b10c39bdc20cad3d4652008c404d576461d75e1.zip |
Merge branch '0.24.x'
Conflicts:
lib/puppet/executables/client/certhandler.rb
spec/unit/executables/client/certhandler.rb
Diffstat (limited to 'spec/unit/parser')
-rwxr-xr-x | spec/unit/parser/interpreter.rb | 27 |
1 files changed, 3 insertions, 24 deletions
diff --git a/spec/unit/parser/interpreter.rb b/spec/unit/parser/interpreter.rb index f2526c73d..27cf7056d 100755 --- a/spec/unit/parser/interpreter.rb +++ b/spec/unit/parser/interpreter.rb @@ -84,7 +84,6 @@ describe Puppet::Parser::Interpreter do oldparser = mock('oldparser') newparser = mock('newparser') oldparser.expects(:reparse?).returns(true) - oldparser.expects(:clear) @interp.expects(:create_parser).with(:myenv).returns(oldparser) @interp.send(:parser, :myenv).should equal(oldparser) @@ -92,36 +91,16 @@ describe Puppet::Parser::Interpreter do @interp.send(:parser, :myenv).should equal(newparser) end - it "should keep the old parser if a new parser cannot be created" do + it "should raise an exception if a new parser cannot be created" do # Get the first parser in the hash. @interp.expects(:create_parser).with(:myenv).returns(@parser) @interp.send(:parser, :myenv).should equal(@parser) - # Have it indicate something has changed @parser.expects(:reparse?).returns(true) - # But fail to create a new parser - @interp.expects(:create_parser).with(:myenv).raises(ArgumentError) + @interp.expects(:create_parser).with(:myenv).raises(Puppet::Error, "Could not parse") - # And make sure we still get the old valid parser - @interp.send(:parser, :myenv).should equal(@parser) - end - - it "should log syntax errors when using the old parser" do - # Get the first parser in the hash. - @interp.stubs(:create_parser).with(:myenv).returns(@parser) - @interp.send(:parser, :myenv) - - # Have it indicate something has changed - @parser.stubs(:reparse?).returns(true) - - # But fail to create a new parser - @interp.stubs(:create_parser).with(:myenv).raises(ArgumentError) - - Puppet.expects(:err) - - # And make sure we still get the old valid parser - @interp.send(:parser, :myenv) + lambda { @interp.parser(:myenv) }.should raise_error(Puppet::Error) end end end |