mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
[rubygems/rubygems] test loading bad plugins with nil/empty names
https://github.com/rubygems/rubygems/commit/e64b1f3497
This commit is contained in:
parent
5cce96891e
commit
a3d2200b2a
2 changed files with 3 additions and 1 deletions
|
@ -309,6 +309,8 @@ module Bundler
|
|||
#
|
||||
# @param [String] name of the plugin
|
||||
def load_plugin(name)
|
||||
return unless name && !name.empty?
|
||||
|
||||
# Need to ensure before this that plugin root where the rest of gems
|
||||
# are installed to be on load path to support plugin deps. Currently not
|
||||
# done to avoid conflicts
|
||||
|
|
|
@ -277,7 +277,7 @@ RSpec.describe Bundler::Plugin do
|
|||
Bundler::Plugin::Events.send(:define, :EVENT_2, "event-2")
|
||||
|
||||
allow(index).to receive(:hook_plugins).with(Bundler::Plugin::Events::EVENT_1).
|
||||
and_return(["foo-plugin"])
|
||||
and_return(["foo-plugin", "", nil])
|
||||
allow(index).to receive(:hook_plugins).with(Bundler::Plugin::Events::EVENT_2).
|
||||
and_return(["foo-plugin"])
|
||||
allow(index).to receive(:plugin_path).with("foo-plugin").and_return(path)
|
||||
|
|
Loading…
Reference in a new issue