diff options
Diffstat (limited to 'test/util')
-rwxr-xr-x | test/util/autoload.rb | 27 |
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$ |