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 <[email protected]> Signed-off-by: Jesse Wolfe <[email protected]> --- lib/puppet/configurer/plugin_handler.rb | 4 +--- spec/unit/configurer/plugin_handler_spec.rb | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/puppet/configurer/plugin_handler.rb b/lib/puppet/configurer/plugin_handler.rb index 539441e..8192d47 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 25d2d47..1423ae4 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") -- 1.7.0.4 -- You received this message because you are subscribed to the Google Groups "Puppet Developers" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/puppet-dev?hl=en.
