diff options
| author | Luke Kanies <luke@madstop.com> | 2007-08-20 19:09:26 -0500 |
|---|---|---|
| committer | Luke Kanies <luke@madstop.com> | 2007-08-20 19:09:26 -0500 |
| commit | 2a4e1011dbc244754f434f7eb97f3d41463e5cd4 (patch) | |
| tree | 584fe59adee0d6057d41093d4c349eb7635de2bf /test/language/parser.rb | |
| parent | 6467c21e15b8a28e627d1395f76fe8f42ee77d70 (diff) | |
| download | puppet-2a4e1011dbc244754f434f7eb97f3d41463e5cd4.tar.gz puppet-2a4e1011dbc244754f434f7eb97f3d41463e5cd4.tar.xz puppet-2a4e1011dbc244754f434f7eb97f3d41463e5cd4.zip | |
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.
Diffstat (limited to 'test/language/parser.rb')
| -rwxr-xr-x | test/language/parser.rb | 14 |
1 files changed, 7 insertions, 7 deletions
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}) |
