diff options
author | Asutosh Palai <asupalai@gmail.com> | 2016-06-07 11:13:46 +0530 |
---|---|---|
committer | Asutosh Palai <asupalai@gmail.com> | 2016-06-07 12:40:19 +0530 |
commit | d4a9f2e7b0fc332d843ce6835c2b29bdae1e9184 (patch) | |
tree | 1480b1371c6f28022058e9284e1524032337a5ca /lib/bundler/plugin.rb | |
parent | 5a30dc76ba27fa12d6ffd56b18cd8e022e69d07e (diff) | |
download | bundler-d4a9f2e7b0fc332d843ce6835c2b29bdae1e9184.tar.gz |
Added unit test form plugin module
Diffstat (limited to 'lib/bundler/plugin.rb')
-rw-r--r-- | lib/bundler/plugin.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/bundler/plugin.rb b/lib/bundler/plugin.rb index 8de8dab06f..7e1f616956 100644 --- a/lib/bundler/plugin.rb +++ b/lib/bundler/plugin.rb @@ -30,7 +30,7 @@ module Bundler register_plugin name, plugin_path Bundler.ui.info "Installed plugin #{name}" - rescue StandardError => e + rescue PluginError => e Bundler.rm_rf(plugin_path) if plugin_path Bundler.ui.error "Failed to install plugin #{name}: #{e.message}\n #{e.backtrace.join("\n ")}" end @@ -111,7 +111,11 @@ module Bundler @commands = {} - load path.join(PLUGIN_FILE_NAME), true + begin + load path.join(PLUGIN_FILE_NAME), true + rescue StandardError => e + raise MalformattedPlugin, "#{e.class}: #{e.message}" + end index.register_plugin name, path.to_s, @commands.keys ensure |