summaryrefslogtreecommitdiffstats
path: root/test/lib
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2007-08-20 19:09:26 -0500
committerLuke Kanies <luke@madstop.com>2007-08-20 19:09:26 -0500
commit2a4e1011dbc244754f434f7eb97f3d41463e5cd4 (patch)
tree584fe59adee0d6057d41093d4c349eb7635de2bf /test/lib
parent6467c21e15b8a28e627d1395f76fe8f42ee77d70 (diff)
downloadpuppet-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/lib')
-rwxr-xr-xtest/lib/puppettest.rb1
-rw-r--r--test/lib/puppettest/parsertesting.rb12
2 files changed, 7 insertions, 6 deletions
diff --git a/test/lib/puppettest.rb b/test/lib/puppettest.rb
index 5c385afb1..b56bc563e 100755
--- a/test/lib/puppettest.rb
+++ b/test/lib/puppettest.rb
@@ -283,6 +283,7 @@ module PuppetTest
rescue Timeout::Error
# just move on
end
+ mocha_verify
if File.stat("/dev/null").mode & 007777 != 0666
File.open("/tmp/nullfailure", "w") { |f|
f.puts self.class
diff --git a/test/lib/puppettest/parsertesting.rb b/test/lib/puppettest/parsertesting.rb
index 368e112f9..0a695cbaa 100644
--- a/test/lib/puppettest/parsertesting.rb
+++ b/test/lib/puppettest/parsertesting.rb
@@ -45,7 +45,7 @@ module PuppetTest::ParserTesting
require 'puppet/network/handler/node'
parser ||= mkparser
node = mknode
- return Config.new(parser, node)
+ return Config.new(node, parser)
end
def mknode(name = nil)
@@ -65,14 +65,14 @@ module PuppetTest::ParserTesting
end
def mkscope(hash = {})
- hash[:configuration] ||= mkconfig
hash[:parser] ||= mkparser
- hash[:source] ||= (hash[:parser].findclass("", "") || hash[:parser].newclass(""))
+ config ||= mkconfig(hash[:parser])
+ config.topscope.source = (hash[:parser].findclass("", "") || hash[:parser].newclass(""))
- unless hash[:source]
+ unless config.topscope.source
raise "Could not find source for scope"
end
- Puppet::Parser::Scope.new(hash)
+ config.topscope
end
def classobj(name, hash = {})
@@ -308,7 +308,7 @@ module PuppetTest::ParserTesting
config = nil
assert_nothing_raised {
- config = interp.run(Facter["hostname"].value, {})
+ config = interp.compile(mknode)
}
comp = nil