From 2a4e1011dbc244754f434f7eb97f3d41463e5cd4 Mon Sep 17 00:00:00 2001 From: Luke Kanies Date: Mon, 20 Aug 2007 19:09:26 -0500 Subject: All language tests now pass. I expect there are other failures elsewhere, but I want to commit this before delving into them. My method for fixing the tests was to do as little as possible, keeping the tests as bad or as good as they were before I started. Mostly this was about changing references to the interpreter into references to the parser (since that is where the new* methods are now for ast containers) and then dealing with the new config object and its relationship to scopes. --- test/language/parser.rb | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'test/language/parser.rb') diff --git a/test/language/parser.rb b/test/language/parser.rb index 77595b155..c172aafca 100755 --- a/test/language/parser.rb +++ b/test/language/parser.rb @@ -38,13 +38,13 @@ class TestParser < Test::Unit::TestCase def test_failers failers { |file| parser = mkparser - interp = mkinterp Puppet.debug("parsing failer %s" % file) if __FILE__ == $0 - assert_raise(Puppet::ParseError) { + assert_raise(Puppet::ParseError, "Did not fail while parsing %s" % file) { parser.file = file ast = parser.parse - scope = mkscope :interp => interp - ast.classes[""].evaluate :scope => scope + config = mkconfig(parser) + config.compile + #ast.classes[""].evaluate :scope => config.topscope } Puppet::Type.allclear } @@ -622,7 +622,7 @@ file { "/tmp/yayness": code = nil assert_nothing_raised do - code = interp.run("hostname.domain.com", {}).flatten + code = interp.compile(mknode).flatten end assert(code.length == 1, "Did not get the file") assert_instance_of(Puppet::TransObject, code[0]) @@ -871,7 +871,8 @@ file { "/tmp/yayness": end def test_newclass - parser = mkparser + scope = mkscope + parser = scope.configuration.parser mkcode = proc do |ary| classes = ary.collect do |string| @@ -880,7 +881,6 @@ file { "/tmp/yayness": AST::ASTArray.new(:children => classes) end - scope = Puppet::Parser::Scope.new(:interp => mkinterp) # First make sure that code is being appended code = mkcode.call(%w{original code}) -- cgit