summaryrefslogtreecommitdiffstats
path: root/test/util
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2007-09-07 15:38:24 -0500
committerLuke Kanies <luke@madstop.com>2007-09-07 15:38:24 -0500
commit6700adcacdec4381ee4a27a215ee4b45207aa448 (patch)
tree92878fa77a20bd76b27ad34507f4f32274ee1ff2 /test/util
parent9af79f117221d93f0d13a2c5ea3e886c6a9d939e (diff)
downloadpuppet-6700adcacdec4381ee4a27a215ee4b45207aa448.tar.gz
puppet-6700adcacdec4381ee4a27a215ee4b45207aa448.tar.xz
puppet-6700adcacdec4381ee4a27a215ee4b45207aa448.zip
*Finally* fixing the tests that were failing around users and groups. The problem was that the autoload tests were somehow clearing all loaded classes, including the providers. This is fixed now.
Diffstat (limited to 'test/util')
-rwxr-xr-xtest/util/autoload.rb27
1 files changed, 1 insertions, 26 deletions
diff --git a/test/util/autoload.rb b/test/util/autoload.rb
index 493fd7f60..bae6d37d4 100755
--- a/test/util/autoload.rb
+++ b/test/util/autoload.rb
@@ -50,11 +50,6 @@ TestAutoload.newthing(:#{name.to_s})
return rbdir, loader
end
- def teardown
- super
- Puppet::Util::Autoload.clear
- end
-
def test_load
dir, loader = mk_loader(:yayness)
@@ -84,36 +79,18 @@ TestAutoload.newthing(:#{name.to_s})
assert(self.class.thing?(:mything),
"Did not get loaded thing")
- # Now clear everything, and test loadall
- assert_nothing_raised {
- Puppet::Util::Autoload.clear
- }
-
self.class.clear
- assert_nothing_raised {
- loader.loadall
- }
-
[:mything, :othing].each do |thing|
+ loader.load(thing)
assert(loader.loaded?(thing), "#{thing.to_s} not considered loaded")
assert(loader.loaded?("%s.rb" % thing), "#{thing.to_s} not considered loaded with .rb")
assert(Puppet::Util::Autoload.loaded?("yayness/%s" % thing), "%s not considered loaded by the main class" % thing)
assert(Puppet::Util::Autoload.loaded?("yayness/%s.rb" % thing), "%s not considered loaded by the main class with .rb" % thing)
- loaded = Puppet::Util::Autoload.loaded?("yayness/%s.rb" % thing)
- assert_equal("%s/%s.rb" % [dir, thing], loaded[:file], "File path was not set correctly in loaded store")
- assert_equal(self.class, loaded[:autoloader], "Loader was not set correctly in loaded store")
-
assert(self.class.thing?(thing),
"Did not get loaded #{thing.to_s}")
end
-
- Puppet::Util::Autoload.clear
- [:mything, :othing].each do |thing|
- assert(! loader.loaded?(thing), "#{thing.to_s} considered loaded after clear")
- assert(! Puppet::Util::Autoload.loaded?("yayness/%s" % thing), "%s considered loaded by the main class after clear" % thing)
- end
end
# Make sure that autoload dynamically modifies $: with the libdir as
@@ -126,5 +103,3 @@ TestAutoload.newthing(:#{name.to_s})
assert(loader.send(:searchpath).include?(dir), "searchpath does not include the libdir")
end
end
-
-# $Id$