From a40e9b7dc58eef2e965e81f6c7be2dc7c14910d9 Mon Sep 17 00:00:00 2001 From: Luke Kanies Date: Tue, 18 Mar 2008 18:16:03 -0500 Subject: Fixing some tests that only failed under certain circumstances (mostly, when loaded with other files, or when loaded from rake or autotest rather than separately). --- test/lib/puppettest.rb | 7 ++++++- test/ral/providers/cron/crontab.rb | 1 - test/ral/providers/sshkey/parsed.rb | 1 - 3 files changed, 6 insertions(+), 3 deletions(-) (limited to 'test') diff --git a/test/lib/puppettest.rb b/test/lib/puppettest.rb index e276bdf0f..63f8121b5 100755 --- a/test/lib/puppettest.rb +++ b/test/lib/puppettest.rb @@ -43,6 +43,10 @@ class Class end module PuppetTest + # These need to be here for when rspec tests use these + # support methods. + @@tmpfiles = [] + # Munge cli arguments, so we can enable debugging if we want # and so we can run just specific methods. def self.munge_argv @@ -189,7 +193,7 @@ module PuppetTest Dir.mkdir(@configpath) end - @@tmpfiles = [@configpath, tmpdir()] + @@tmpfiles << @configpath << tmpdir() @@tmppids = [] @@cleaners = [] @@ -293,6 +297,7 @@ module PuppetTest } @@tmppids.clear + Puppet::Type.allclear Puppet::Util::Storage.clear Puppet.clear diff --git a/test/ral/providers/cron/crontab.rb b/test/ral/providers/cron/crontab.rb index 1ff1e34ef..53bd76c50 100755 --- a/test/ral/providers/cron/crontab.rb +++ b/test/ral/providers/cron/crontab.rb @@ -5,7 +5,6 @@ require File.dirname(__FILE__) + '/../../../lib/puppettest' require 'puppettest' require 'mocha' require 'puppettest/fileparsing' -require 'puppet/type/cron' class TestCronParsedProvider < Test::Unit::TestCase include PuppetTest diff --git a/test/ral/providers/sshkey/parsed.rb b/test/ral/providers/sshkey/parsed.rb index b94b7a69a..4f18e6494 100755 --- a/test/ral/providers/sshkey/parsed.rb +++ b/test/ral/providers/sshkey/parsed.rb @@ -4,7 +4,6 @@ require File.dirname(__FILE__) + '/../../../lib/puppettest' require 'puppettest' require 'puppettest/fileparsing' -require 'puppet/type/sshkey' class TestParsedSSHKey < Test::Unit::TestCase include PuppetTest -- cgit