summaryrefslogtreecommitdiffstats
path: root/spec/unit/parser
diff options
context:
space:
mode:
authorJames Turnbull <james@lovedthanlost.net>2008-06-15 10:29:41 +1000
committerJames Turnbull <james@lovedthanlost.net>2008-06-15 10:29:41 +1000
commit575f37a0656f5a1f94fe6fb1b189d1701a98cadc (patch)
tree4ee5eeb6a04e77febac3fe64c6e91ca2053463a3 /spec/unit/parser
parent4d70449a61b2e1ed198b38c8e75a44410c6adcaf (diff)
parent4539b1cccbc5bf6287e322d7296c4b7cfc47e4ce (diff)
downloadpuppet-575f37a0656f5a1f94fe6fb1b189d1701a98cadc.tar.gz
puppet-575f37a0656f5a1f94fe6fb1b189d1701a98cadc.tar.xz
puppet-575f37a0656f5a1f94fe6fb1b189d1701a98cadc.zip
Merge branch 'ticket/0.24.x/1215' of git://github.com/littleidea/puppet into 0.24.x
Diffstat (limited to 'spec/unit/parser')
-rwxr-xr-xspec/unit/parser/interpreter.rb27
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