summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Wolfe <jes5199@gmail.com>2010-12-10 12:46:15 -0800
committerJesse Wolfe <jes5199@gmail.com>2010-12-10 14:27:25 -0800
commit8c134b697d2c30128f51cd69e47808a051b96b72 (patch)
tree3f0f34169873fcef79d4570309b079024d1fbcc2
parent5c8489be9c3ee62c14b524a6d0d4a96dca5b9764 (diff)
downloadpuppet-8c134b697d2c30128f51cd69e47808a051b96b72.tar.gz
puppet-8c134b697d2c30128f51cd69e47808a051b96b72.tar.xz
puppet-8c134b697d2c30128f51cd69e47808a051b96b72.zip
maint: broken test not failing due to over-eager exception catching
A test was not testing what it claimed, but the failure exception was getting swallowed by an unnecessarily broad rescue match. Paired-With: Nick Lewis <nick@puppetlabs.com>
-rw-r--r--lib/puppet/configurer/plugin_handler.rb4
-rwxr-xr-xspec/unit/configurer/plugin_handler_spec.rb2
2 files changed, 2 insertions, 4 deletions
diff --git a/lib/puppet/configurer/plugin_handler.rb b/lib/puppet/configurer/plugin_handler.rb
index 539441e75..8192d4719 100644
--- a/lib/puppet/configurer/plugin_handler.rb
+++ b/lib/puppet/configurer/plugin_handler.rb
@@ -19,9 +19,7 @@ module Puppet::Configurer::PluginHandler
begin
Puppet.info "Loading downloaded plugin #{file}"
load file
- rescue SystemExit,NoMemoryError
- raise
- rescue Exception => detail
+ rescue StandardError, LoadError => detail
Puppet.err "Could not load downloaded file #{file}: #{detail}"
end
end
diff --git a/spec/unit/configurer/plugin_handler_spec.rb b/spec/unit/configurer/plugin_handler_spec.rb
index 25d2d47af..1423ae4b5 100755
--- a/spec/unit/configurer/plugin_handler_spec.rb
+++ b/spec/unit/configurer/plugin_handler_spec.rb
@@ -80,7 +80,7 @@ describe Puppet::Configurer::PluginHandler do
end
it "should not try to load files that don't exist" do
- FileTest.expects(:exist?).with("foo").returns true
+ FileTest.expects(:exist?).with("foo").returns false
@pluginhandler.expects(:load).never
@pluginhandler.load_plugin("foo")