diff options
author | Luke Kanies <luke@madstop.com> | 2009-05-16 00:08:35 -0500 |
---|---|---|
committer | James Turnbull <james@lovedthanlost.net> | 2009-05-20 18:29:04 +1000 |
commit | 138f19fc6e7bb1d8ebf305decaa045c53787297c (patch) | |
tree | 00cb8da45f0ff7b12fede738b7df9e045a1583a9 /spec/unit/util/autoload.rb | |
parent | 415553e9485d7ba3ed867033ac9c3315107d3c92 (diff) | |
download | puppet-138f19fc6e7bb1d8ebf305decaa045c53787297c.tar.gz puppet-138f19fc6e7bb1d8ebf305decaa045c53787297c.tar.xz puppet-138f19fc6e7bb1d8ebf305decaa045c53787297c.zip |
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 <luke@madstop.com>
Diffstat (limited to 'spec/unit/util/autoload.rb')
-rwxr-xr-x | spec/unit/util/autoload.rb | 8 |
1 files changed, 7 insertions, 1 deletions
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 |