summaryrefslogtreecommitdiffstats
path: root/test/lib
diff options
context:
space:
mode:
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