diff options
Diffstat (limited to 'spec/unit/util/feature_spec.rb')
-rwxr-xr-x | spec/unit/util/feature_spec.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/unit/util/feature_spec.rb b/spec/unit/util/feature_spec.rb index aa8afbba6..e6d844533 100755 --- a/spec/unit/util/feature_spec.rb +++ b/spec/unit/util/feature_spec.rb @@ -91,4 +91,16 @@ describe Puppet::Util::Feature do @features.should_not be_myfeature @features.should be_myfeature end + + it "should cache load failures when configured to do so" do + Puppet[:always_cache_features] = true + + @features.add(:myfeature, :libs => %w{foo bar}) + @features.expects(:require).with("foo").raises(LoadError) + + @features.should_not be_myfeature + # second call would cause an expectation exception if 'require' was + # called a second time + @features.should_not be_myfeature + end end |