From 138f19fc6e7bb1d8ebf305decaa045c53787297c Mon Sep 17 00:00:00 2001 From: Luke Kanies Date: Sat, 16 May 2009 00:08:35 -0500 Subject: Caching whether named autoloaded files are missing This is the big win, because it causes us to just skip the whole loading infrastructure, including skipping looking through the modulepath. Signed-off-by: Luke Kanies --- spec/unit/util/autoload.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'spec/unit/util/autoload.rb') diff --git a/spec/unit/util/autoload.rb b/spec/unit/util/autoload.rb index 3bd5b50ad..d05bc15f0 100755 --- a/spec/unit/util/autoload.rb +++ b/spec/unit/util/autoload.rb @@ -71,11 +71,17 @@ describe Puppet::Util::Autoload do end it "should skip files that it knows are missing" do - @autoload.expects(:missing_file?).returns true + @autoload.expects(:named_file_missing?).with("foo").returns true @autoload.expects(:eachdir).never @autoload.load("foo") end + + it "should register that files are missing if they cannot be found" do + @autoload.load("foo") + + @autoload.should be_named_file_missing("foo") + end end describe "when loading all files" do -- cgit